Skip to content

Commit a3599b1

Browse files
committed
Proper sub-package path
1 parent 793afe4 commit a3599b1

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
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({ fileName }, packagePath, version) {
81+
function unpack({ name }, 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, fileName, 'Payload'));
85+
const extractedPath = yield toolCache.extractTar(path.join(unpackedPath, `${name}-package.pkg`, '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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ function swiftPackage(version, system) {
6060
}
6161
return {
6262
url: `https://swift.org/builds/swift-${version}-release/${platform}/swift-${version}-RELEASE/${archiveFile}`,
63-
name: archiveName,
64-
fileName: archiveFile
63+
name: archiveName
6564
};
6665
}
6766
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({ fileName }: Package, packagePath: string, version: string) {
75+
async function unpack({ name }: 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, fileName, 'Payload'))
78+
const extractedPath = await toolCache.extractTar(path.join(unpackedPath, `${name}-package.pkg`, '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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ function notEmpty<T>(value: T | null | undefined): value is T {
3737
export interface Package {
3838
url: string
3939
name: string
40-
fileName: string
4140
}
4241

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

6362
return {
6463
url: `https://swift.org/builds/swift-${version}-release/${platform}/swift-${version}-RELEASE/${archiveFile}`,
65-
name: archiveName,
66-
fileName: archiveFile
64+
name: archiveName
6765
}
6866
}
6967

0 commit comments

Comments
 (0)