Bypass Electron CLI OTA Flash Confirmation? [Solved - YES!]


#1

Is there any way to bypass the confirmation required by CLI when flashing OTA? I’m using Visual Studio Code and this tutorial to create compile and flash tasks and I can’t enter any additional input once the tasks are run. Here’s the confirmation I’m trying to bypass:

I’ve tried piping an echo of the value I have to enter after flashing (0.005) and I tried to run it as a second command using && after a delay. Here is my tasks.json file:

Additional info: using Visual Studio Code 1.6.1 and Particle 1.7.0 on Windows 7.

Thanks!


Use Visual Studio Code for your Particle development needs
#2

I’d comment out that part in the CLI scripts.


#3

Where exactly can I find the CLI scripts?


#4

Seeing as it’s something you’ve installed on your computer, you’ll find them in their respective directory. Depending on how you installed them, look for either a ‘particle’ directory, or check your NPM directory for the particle-cli. I believe mine were in C:\Users\[name]\AppData\Roaming\npm\node_modules


#5

Got it to work, thanks!

In case anyone else is running into this problem, locate the file in C:\Users\[name]\AppData\Roaming\npm\node_modules\particle-cli\commands\CloudCommands.js. Modify the _promptForOta function as such:

I commented out from console.log() to the end of inquirer.prompt and kept only the resolve({list:[filename]}) line.


#6

Thanks for the help @Moors7 @ScruffR!


#7

UPDATE: @chrissy’s fix has slightly changed.

I think it’d be nice to have an override, like an extension to the existing --force flag or maybe a new flag like --ota-yes, to force CLI to ignore this blocking check.