mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-27 14:30:07 +00:00
resin sync: add --destination option and require --source if .resin-sync.yml is missing
Closes #359
This commit is contained in:
parent
81d8974213
commit
fdb8bf6967
@ -16,17 +16,21 @@ limitations under the License.
|
|||||||
|
|
||||||
module.exports =
|
module.exports =
|
||||||
signature: 'sync [uuid]'
|
signature: 'sync [uuid]'
|
||||||
description: '(beta) sync your changes with a device'
|
description: '(beta) sync your changes to a device'
|
||||||
help: '''
|
help: '''
|
||||||
WARNING: If you're running Windows, this command only supports `cmd.exe`.
|
WARNING: If you're running Windows, this command only supports `cmd.exe`.
|
||||||
|
|
||||||
Use this command to sync your local changes to a certain device on the fly.
|
Use this command to sync your local changes to a certain device on the fly.
|
||||||
|
|
||||||
You can save all the options mentioned below in a `resin-sync.yml` file,
|
After every 'resin sync' the updated settings will be saved in
|
||||||
by using the same option names as keys. For example:
|
'<source>/.resin-sync.yml' and will be used in later invocations. You can
|
||||||
|
also change any option by editing '.resin-sync.yml' directly.
|
||||||
|
|
||||||
$ cat $PWD/resin-sync.yml
|
Here is an example '.resin-sync.yml' :
|
||||||
source: src/
|
|
||||||
|
$ cat $PWD/.resin-sync.yml
|
||||||
|
uuid: 7cf02a6
|
||||||
|
destination: '/usr/src/app'
|
||||||
before: 'echo Hello'
|
before: 'echo Hello'
|
||||||
ignore:
|
ignore:
|
||||||
- .git
|
- .git
|
||||||
@ -36,21 +40,29 @@ module.exports =
|
|||||||
|
|
||||||
Notice that explicitly passed command options override the ones set in the configuration file.
|
Notice that explicitly passed command options override the ones set in the configuration file.
|
||||||
|
|
||||||
|
Also, if '.gitignore' is found in the source directory then all explicitly listed files will be
|
||||||
|
excluded from the syncing process.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
$ resin sync MyApp
|
$ resin sync 7cf02a6 --source '.' --destination '/usr/src/app'
|
||||||
$ resin sync 7cf02a6
|
$ resin sync 7cf02a6 -s '/home/user/myResinProject' -d '/usr/src/app' --before 'echo Hello'
|
||||||
$ resin sync 7cf02a6 --port 8080
|
$ resin sync --ignore 'lib/'
|
||||||
$ resin sync 7cf02a6 --ignore foo,bar
|
$ resin sync --verbose false
|
||||||
$ resin sync 7cf02a6 -v
|
$ resin sync
|
||||||
'''
|
'''
|
||||||
permission: 'user'
|
permission: 'user'
|
||||||
primary: true
|
primary: true
|
||||||
options: [
|
options: [
|
||||||
signature: 'source'
|
signature: 'source'
|
||||||
parameter: 'path'
|
parameter: 'path'
|
||||||
description: 'custom source path'
|
description: 'local directory path to synchronize to device'
|
||||||
alias: 's'
|
alias: 's'
|
||||||
|
,
|
||||||
|
signature: 'destination'
|
||||||
|
parameter: 'path'
|
||||||
|
description: 'destination path on device'
|
||||||
|
alias: 'd'
|
||||||
,
|
,
|
||||||
signature: 'ignore'
|
signature: 'ignore'
|
||||||
parameter: 'paths'
|
parameter: 'paths'
|
||||||
@ -79,6 +91,8 @@ module.exports =
|
|||||||
,
|
,
|
||||||
]
|
]
|
||||||
action: (params, options, done) ->
|
action: (params, options, done) ->
|
||||||
|
fs = require('fs')
|
||||||
|
path = require('path')
|
||||||
resin = require('resin-sdk')
|
resin = require('resin-sdk')
|
||||||
Promise = require('bluebird')
|
Promise = require('bluebird')
|
||||||
resinSync = require('resin-sync')
|
resinSync = require('resin-sync')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user