Skip to content

Commit

Permalink
Merge pull request #2 from AledLewis/master
Browse files Browse the repository at this point in the history
Fix windows file-system case sensitivity when relativising files
  • Loading branch information
Palmr committed Oct 21, 2015
2 parents c2309d9 + fcbda8a commit 4b45d0a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/com/fivium/scriptrunner2/builder/ManifestBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import java.io.IOException;
import java.io.PrintWriter;

import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.text.SimpleDateFormat;

import java.util.ArrayList;
Expand Down Expand Up @@ -145,7 +147,10 @@ public File getBaseDirectory() {

@Override
public String relativeFilePath(File pFile){
return ScriptRunner.normaliseFilePath(mBaseDirectory.toURI().relativize(pFile.toURI()).getPath());
Path lBaseDirectoryPath = FileSystems.getDefault().getPath(mBaseDirectory.getAbsolutePath());
Path lFilePath = FileSystems.getDefault().getPath(pFile.getAbsolutePath());
Path lRelative = lBaseDirectoryPath.relativize(lFilePath);
return ScriptRunner.normaliseFilePath(lRelative.toString());
}

/**
Expand Down

0 comments on commit 4b45d0a

Please sign in to comment.