Skip to content

Commit

Permalink
refactor: archiveApp — use basename
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Oct 6, 2016
1 parent e52c730 commit 106eea7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/targets/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export async function archiveApp(compression: CompressionLevel | n, format: stri
args.push("-mm=" + (storeOnly ? "Copy" : "Deflate"))
}

args.push(outFile, withoutDir ? "." : dirToArchive)
args.push(outFile, withoutDir ? "." : path.basename(dirToArchive))

await spawn(path7za, args, {
cwd: withoutDir ? dirToArchive : path.dirname(dirToArchive),
Expand Down
5 changes: 4 additions & 1 deletion test/src/macPackagerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function createTargetTest(target: Array<string>, expectedContents: Array<string>
}
}
}, {
useTempDir: true,
expectedContents: expectedContents,
signed: target.includes("mas"),
packed: async (context) => {
Expand All @@ -52,7 +53,9 @@ function createTargetTest(target: Array<string>, expectedContents: Array<string>
test("only zip", createTargetTest(["zip"], ["Test App ßW-1.1.0-mac.zip"]))

test("tar.gz", createTargetTest(["tar.gz"], ["Test App ßW-1.1.0-mac.tar.gz"]))
test("tar.xz", createTargetTest(["tar.xz"], ["Test App ßW-1.1.0-mac.tar.xz"]))

// todo failed on Travis CI
//test("tar.xz", createTargetTest(["tar.xz"], ["Test App ßW-1.1.0-mac.tar.xz"]))

test.ifOsx("invalid target", t => t.throws(createTargetTest(["ttt"], [])(), "Unknown target: ttt"))

Expand Down

0 comments on commit 106eea7

Please sign in to comment.