File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1196,11 +1196,20 @@ class BinaryControl {
1196
1196
};
1197
1197
}
1198
1198
1199
+ _binaryExists() {
1200
+ const localBinary = tc.findAllVersions(LOCAL_BINARY_NAME);
1201
+ return localBinary.length ? true : false;
1202
+ }
1203
+
1199
1204
/**
1200
1205
* Downloads the Local Binary, extracts it and adds it in the PATH variable
1201
1206
*/
1202
1207
async downloadBinary() {
1203
1208
try {
1209
+ if (this._binaryExists()) {
1210
+ core.info('BrowserStackLocal binary already exists in cache. Using that instead of downloading again...');
1211
+ return;
1212
+ }
1204
1213
await this._makeDirectory();
1205
1214
core.info('Downloading BrowserStackLocal binary...');
1206
1215
const downloadPath = await tc.downloadTool(this.binaryLink, path.resolve(this.binaryFolder, 'binaryZip'));
Original file line number Diff line number Diff line change @@ -131,11 +131,20 @@ class BinaryControl {
131
131
} ;
132
132
}
133
133
134
+ _binaryExists ( ) {
135
+ const localBinary = tc . findAllVersions ( LOCAL_BINARY_NAME ) ;
136
+ return localBinary . length ? true : false ;
137
+ }
138
+
134
139
/**
135
140
* Downloads the Local Binary, extracts it and adds it in the PATH variable
136
141
*/
137
142
async downloadBinary ( ) {
138
143
try {
144
+ if ( this . _binaryExists ( ) ) {
145
+ core . info ( 'BrowserStackLocal binary already exists in cache. Using that instead of downloading again...' ) ;
146
+ return ;
147
+ }
139
148
await this . _makeDirectory ( ) ;
140
149
core . info ( 'Downloading BrowserStackLocal binary...' ) ;
141
150
const downloadPath = await tc . downloadTool ( this . binaryLink , path . resolve ( this . binaryFolder , 'binaryZip' ) ) ;
You can’t perform that action at this time.
0 commit comments