Skip to content

Commit f4a8084

Browse files
committed
debug: re-download of binary check
1 parent 3a1b742 commit f4a8084

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

setup-local/dist/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,11 +1196,20 @@ class BinaryControl {
11961196
};
11971197
}
11981198

1199+
_binaryExists() {
1200+
const localBinary = tc.findAllVersions(LOCAL_BINARY_NAME);
1201+
return localBinary.length ? true : false;
1202+
}
1203+
11991204
/**
12001205
* Downloads the Local Binary, extracts it and adds it in the PATH variable
12011206
*/
12021207
async downloadBinary() {
12031208
try {
1209+
if (this._binaryExists()) {
1210+
core.info('BrowserStackLocal binary already exists in cache. Using that instead of downloading again...');
1211+
return;
1212+
}
12041213
await this._makeDirectory();
12051214
core.info('Downloading BrowserStackLocal binary...');
12061215
const downloadPath = await tc.downloadTool(this.binaryLink, path.resolve(this.binaryFolder, 'binaryZip'));

setup-local/src/binaryControl.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,20 @@ class BinaryControl {
131131
};
132132
}
133133

134+
_binaryExists() {
135+
const localBinary = tc.findAllVersions(LOCAL_BINARY_NAME);
136+
return localBinary.length ? true : false;
137+
}
138+
134139
/**
135140
* Downloads the Local Binary, extracts it and adds it in the PATH variable
136141
*/
137142
async downloadBinary() {
138143
try {
144+
if (this._binaryExists()) {
145+
core.info('BrowserStackLocal binary already exists in cache. Using that instead of downloading again...');
146+
return;
147+
}
139148
await this._makeDirectory();
140149
core.info('Downloading BrowserStackLocal binary...');
141150
const downloadPath = await tc.downloadTool(this.binaryLink, path.resolve(this.binaryFolder, 'binaryZip'));

0 commit comments

Comments
 (0)