From 1e2e48b149dd876d2abe2c9cecd6de34e0b8fa27 Mon Sep 17 00:00:00 2001 From: Paulo Castro Date: Thu, 30 May 2019 15:18:58 +0100 Subject: [PATCH] Revert 'balena flash' to 'balena local flash' Change-type: major Signed-off-by: Paulo Castro --- doc/cli.markdown | 21 +++++++++++++++++++++ lib/actions/index.coffee | 1 - lib/actions/{ => local}/flash.ts | 10 +++++----- lib/actions/local/index.coffee | 1 + lib/app-capitano.coffee | 2 +- 5 files changed, 28 insertions(+), 7 deletions(-) rename lib/actions/{ => local}/flash.ts (90%) diff --git a/doc/cli.markdown b/doc/cli.markdown index ab7f1b80..29de8a16 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -178,6 +178,7 @@ If you come across any problems or would like to get in touch: - Local - [local configure <target>](#local-configure-target) + - [local flash <image>](#local-flash-image) - Deploy @@ -1485,6 +1486,26 @@ Examples: $ balena local configure /dev/sdc $ balena local configure path/to/image.img +## local flash <image> + +Use this command to flash a balenaOS image to a drive. + +Examples: + + $ balena local flash path/to/balenaos.img[.zip|.gz|.bz2|.xz] + $ balena local flash path/to/balenaos.img --drive /dev/disk2 + $ balena local flash path/to/balenaos.img --drive /dev/disk2 --yes + +### Options + +#### --yes, -y + +confirm non-interactively + +#### --drive, -d <drive> + +drive + # Deploy ## build [source] diff --git a/lib/actions/index.coffee b/lib/actions/index.coffee index f16e27eb..b3b3ffcf 100644 --- a/lib/actions/index.coffee +++ b/lib/actions/index.coffee @@ -26,7 +26,6 @@ module.exports = logs: require('./logs') local: require('./local') scan: require('./scan') - flash: require('./flash').flash notes: require('./notes') help: require('./help') os: require('./os') diff --git a/lib/actions/flash.ts b/lib/actions/local/flash.ts similarity index 90% rename from lib/actions/flash.ts rename to lib/actions/local/flash.ts index 2bbced85..b11c406b 100644 --- a/lib/actions/flash.ts +++ b/lib/actions/local/flash.ts @@ -35,7 +35,7 @@ async function getDrive(options: { } drive = d; } else { - const { DriveList } = await import('../utils/visuals/drive-list'); + const { DriveList } = await import('../../utils/visuals/drive-list'); const driveList = new DriveList(scanner); drive = await driveList.run(); } @@ -47,16 +47,16 @@ export const flash: CommandDefinition< { image: string }, { drive: string; yes: boolean } > = { - signature: 'flash ', + signature: 'local flash ', description: 'Flash an image to a drive', help: stripIndent` Use this command to flash a balenaOS image to a drive. Examples: - $ balena flash path/to/balenaos.img[.zip|.gz|.bz2|.xz] - $ balena flash path/to/balenaos.img --drive /dev/disk2 - $ balena flash path/to/balenaos.img --drive /dev/disk2 --yes + $ balena local flash path/to/balenaos.img[.zip|.gz|.bz2|.xz] + $ balena local flash path/to/balenaos.img --drive /dev/disk2 + $ balena local flash path/to/balenaos.img --drive /dev/disk2 --yes `, options: [ { diff --git a/lib/actions/local/index.coffee b/lib/actions/local/index.coffee index eb6484b2..e089ffaa 100644 --- a/lib/actions/local/index.coffee +++ b/lib/actions/local/index.coffee @@ -15,3 +15,4 @@ limitations under the License. ### exports.configure = require('./configure') +exports.flash = require('./flash').flash diff --git a/lib/app-capitano.coffee b/lib/app-capitano.coffee index d9848934..4d552948 100644 --- a/lib/app-capitano.coffee +++ b/lib/app-capitano.coffee @@ -122,7 +122,7 @@ capitano.command(actions.ssh.ssh) # ---------- Local balenaOS Module ---------- capitano.command(actions.local.configure) -capitano.command(actions.flash) +capitano.command(actions.local.flash) capitano.command(actions.scan) # ---------- Public utils ----------