Skip to content

Commit fcd4ed4

Browse files
committed
debug extraction permission
1 parent ff85007 commit fcd4ed4

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

setup-local/dist/index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,18 +1108,23 @@ class BinaryControl {
11081108
* platform and the architecture
11091109
*/
11101110
_decidePlatformAndBinary() {
1111+
this.binaryFolder = path.resolve(
1112+
process.env.GITHUB_WORKSPACE,
1113+
'..', '..', '..',
1114+
'_work',
1115+
'binary',
1116+
LOCAL_BINARY_FOLDER,
1117+
this.platform,
1118+
);
11111119
switch (this.platform) {
11121120
case PLATFORMS.DARWIN:
11131121
this.binaryLink = BINARY_LINKS.DARWIN;
1114-
this.binaryFolder = path.resolve(process.env.GITHUB_WORKSPACE, '..', '..', '..', '_work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
11151122
break;
11161123
case PLATFORMS.LINUX:
11171124
this.binaryLink = os.arch() === 'x32' ? BINARY_LINKS.LINUX_32 : BINARY_LINKS.LINUX_64;
1118-
this.binaryFolder = path.resolve(process.env.GITHUB_WORKSPACE, '..', '..', '..', '_work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
11191125
break;
11201126
case PLATFORMS.WIN32:
11211127
this.binaryLink = BINARY_LINKS.WINDOWS;
1122-
this.binaryFolder = path.resolve(process.env.GITHUB_WORKSPACE, '..', '..', '..', '_work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
11231128
break;
11241129
default:
11251130
throw Error(`Unsupported Platform: ${this.platform}. No BrowserStackLocal binary found.`);
@@ -1238,8 +1243,8 @@ class BinaryControl {
12381243
core.info('Downloading BrowserStackLocal binary...');
12391244
const downloadPath = await tc.downloadTool(this.binaryLink, path.resolve(this.binaryFolder, 'binaryZip'));
12401245
core.info(`Downloaded Path: ${downloadPath}`);
1241-
// const extractedPath = await tc.extractZip(downloadPath, this.binaryFolder);
1242-
// core.info(`BrowserStackLocal binary downloaded & extracted successfuly at: ${extractedPath}`);
1246+
const extractedPath = await tc.extractZip(downloadPath, this.binaryFolder);
1247+
core.info(`BrowserStackLocal binary downloaded & extracted successfuly at: ${extractedPath}`);
12431248
// const cachedPath = await tc.cacheDir(extractedPath, LOCAL_BINARY_NAME, '1.0.0');
12441249
// core.addPath(cachedPath);
12451250
} catch (e) {

setup-local/src/binaryControl.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,23 @@ class BinaryControl {
4343
* platform and the architecture
4444
*/
4545
_decidePlatformAndBinary() {
46+
this.binaryFolder = path.resolve(
47+
process.env.GITHUB_WORKSPACE,
48+
'..', '..', '..',
49+
'_work',
50+
'binary',
51+
LOCAL_BINARY_FOLDER,
52+
this.platform,
53+
);
4654
switch (this.platform) {
4755
case PLATFORMS.DARWIN:
4856
this.binaryLink = BINARY_LINKS.DARWIN;
49-
this.binaryFolder = path.resolve(process.env.GITHUB_WORKSPACE, '..', '..', '..', '_work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
5057
break;
5158
case PLATFORMS.LINUX:
5259
this.binaryLink = os.arch() === 'x32' ? BINARY_LINKS.LINUX_32 : BINARY_LINKS.LINUX_64;
53-
this.binaryFolder = path.resolve(process.env.GITHUB_WORKSPACE, '..', '..', '..', '_work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
5460
break;
5561
case PLATFORMS.WIN32:
5662
this.binaryLink = BINARY_LINKS.WINDOWS;
57-
this.binaryFolder = path.resolve(process.env.GITHUB_WORKSPACE, '..', '..', '..', '_work', 'binary', LOCAL_BINARY_FOLDER, this.platform);
5863
break;
5964
default:
6065
throw Error(`Unsupported Platform: ${this.platform}. No BrowserStackLocal binary found.`);
@@ -173,8 +178,8 @@ class BinaryControl {
173178
core.info('Downloading BrowserStackLocal binary...');
174179
const downloadPath = await tc.downloadTool(this.binaryLink, path.resolve(this.binaryFolder, 'binaryZip'));
175180
core.info(`Downloaded Path: ${downloadPath}`);
176-
// const extractedPath = await tc.extractZip(downloadPath, this.binaryFolder);
177-
// core.info(`BrowserStackLocal binary downloaded & extracted successfuly at: ${extractedPath}`);
181+
const extractedPath = await tc.extractZip(downloadPath, this.binaryFolder);
182+
core.info(`BrowserStackLocal binary downloaded & extracted successfuly at: ${extractedPath}`);
178183
// const cachedPath = await tc.cacheDir(extractedPath, LOCAL_BINARY_NAME, '1.0.0');
179184
// core.addPath(cachedPath);
180185
} catch (e) {

0 commit comments

Comments
 (0)