Skip to content

Commit

Permalink
fix(exposed/fs): fixes relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed Apr 29, 2019
1 parent 6e709b8 commit 0513950
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/exposed/fs/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function copy(src: string, dest: string, ...args: any[]): () => Promise<void> {
dest = absolute({ path: dest, cwd });

const relatives = {
src: path.relative(src, cwd),
dest: path.relative(dest, cwd)
src: path.relative(cwd, src),
dest: path.relative(cwd, dest)
};

const srcExist = await exists(src, { fail: options.fail });
Expand Down
4 changes: 2 additions & 2 deletions src/exposed/fs/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ function move(
dest = absolute({ path: dest, cwd });

const relatives = {
src: path.relative(src, cwd),
dest: path.relative(dest, cwd)
src: path.relative(cwd, src),
dest: path.relative(cwd, dest)
};

const srcExist = await exists(src, { fail: options.fail });
Expand Down
2 changes: 1 addition & 1 deletion src/exposed/fs/rw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function rw(
return async () => {
const cwd = await core.cwd();
file = absolute({ path: file, cwd });
const relative = path.relative(file, cwd);
const relative = path.relative(cwd, file);

const doesExist = await exists(file, { fail: options.fail });

Expand Down
2 changes: 1 addition & 1 deletion src/exposed/fs/write.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function write(file: string, ...args: any[]): () => Promise<void> {

const cwd = await core.cwd();
file = absolute({ path: file, cwd });
const relative = path.relative(file, cwd);
const relative = path.relative(cwd, file);

const doesExist = await exists(file);
if (options.fail && doesExist) {
Expand Down

0 comments on commit 0513950

Please sign in to comment.