@@ -1239,7 +1239,7 @@ class BinaryControl {
12391239 try {
12401240 await this._makeDirectory();
12411241 core.debug('BrowserStackLocal binary not found in cache. Deleting any stale/existing binary before downloading...');
1242- this._removeAnyStaleBinary();
1242+ await this._removeAnyStaleBinary();
12431243
12441244 core.info('Downloading BrowserStackLocal binary...');
12451245 const downloadPath = await tc.downloadTool(
@@ -1259,6 +1259,7 @@ class BinaryControl {
12591259 * Starts Local Binary using the args generated for this action
12601260 */
12611261 async startBinary() {
1262+ this._generateArgsForBinary();
12621263 let { localIdentifier } = this.stateForBinary;
12631264 localIdentifier = localIdentifier ? `with local-identifier=${localIdentifier}` : '';
12641265 core.info(`Starting local tunnel ${localIdentifier} in daemon mode...`);
@@ -1267,8 +1268,6 @@ class BinaryControl {
12671268
12681269 while (triesAvailable--) {
12691270 try {
1270- this._generateArgsForBinary();
1271-
12721271 // eslint-disable-next-line no-await-in-loop
12731272 const { output, error } = await this._triggerBinary(LOCAL_TESTING.START);
12741273
@@ -1299,8 +1298,8 @@ class BinaryControl {
12991298 * Stops Local Binary using the args generated for this action
13001299 */
13011300 async stopBinary() {
1301+ this._generateArgsForBinary();
13021302 try {
1303- this._generateArgsForBinary();
13041303 let { localIdentifier } = this.stateForBinary;
13051304 localIdentifier = localIdentifier ? `with local-identifier=${localIdentifier}` : '';
13061305 core.info(`Stopping local tunnel ${localIdentifier} in daemon mode...`);
0 commit comments