Skip to content

Commit 793afe4

Browse files
committed
Pass filename to extractor
1 parent a368b55 commit 793afe4

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

lib/macos-install.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ function download({ url }) {
7878
return toolCache.downloadTool(url);
7979
});
8080
}
81-
function unpack({ name }, packagePath, version) {
81+
function unpack({ fileName }, packagePath, version) {
8282
return __awaiter(this, void 0, void 0, function* () {
8383
core.debug('Extracting package');
8484
const unpackedPath = yield extractXar(packagePath);
85-
const extractedPath = yield toolCache.extractTar(path.join(unpackedPath, name, 'Payload'));
85+
const extractedPath = yield toolCache.extractTar(path.join(unpackedPath, fileName, 'Payload'));
8686
core.debug('Package extracted');
8787
const cachedPath = yield toolCache.cacheDir(extractedPath, 'swift-macOS', version);
8888
core.debug('Package cached');

lib/swift-versions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ function swiftPackage(version, system) {
6060
}
6161
return {
6262
url: `https://swift.org/builds/swift-${version}-release/${platform}/swift-${version}-RELEASE/${archiveFile}`,
63-
name: archiveName
63+
name: archiveName,
64+
fileName: archiveFile
6465
};
6566
}
6667
exports.swiftPackage = swiftPackage;

src/macos-install.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ async function download({ url }: Package) {
7272
return toolCache.downloadTool(url)
7373
}
7474

75-
async function unpack({ name }: Package, packagePath: string, version: string) {
75+
async function unpack({ fileName }: Package, packagePath: string, version: string) {
7676
core.debug('Extracting package')
7777
const unpackedPath = await extractXar(packagePath)
78-
const extractedPath = await toolCache.extractTar(path.join(unpackedPath, name, 'Payload'))
78+
const extractedPath = await toolCache.extractTar(path.join(unpackedPath, fileName, 'Payload'))
7979
core.debug('Package extracted')
8080
const cachedPath = await toolCache.cacheDir(extractedPath, 'swift-macOS', version)
8181
core.debug('Package cached')

src/swift-versions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function notEmpty<T>(value: T | null | undefined): value is T {
3737
export interface Package {
3838
url: string
3939
name: string
40+
fileName: string
4041
}
4142

4243
export function swiftPackage(version: string, system: System): Package {
@@ -61,7 +62,8 @@ export function swiftPackage(version: string, system: System): Package {
6162

6263
return {
6364
url: `https://swift.org/builds/swift-${version}-release/${platform}/swift-${version}-RELEASE/${archiveFile}`,
64-
name: archiveName
65+
name: archiveName,
66+
fileName: archiveFile
6567
}
6668
}
6769

0 commit comments

Comments
 (0)