diff --git a/README.md b/README.md index ef4ed18..7949e3e 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ kickstart compile Takes an host target and deploy the compiled code on it. ```bash -kickstart deploy [target] [roles ...] +kickstart deploy [--sudo] [target] [roles ...] ``` ##### Examples @@ -79,7 +79,7 @@ kickstart deploy "-p 2222 vagrant@localhost" nodejs redis Deploy localy a recipe that is not over ssh. It basicaly compile and run the install script ```bash -kickstart local [roles ...] +kickstart local [--sudo] [roles ...] ``` #### infect diff --git a/lib/kickstart-deploy b/lib/kickstart-deploy index 1dcd696..2e8aee1 100755 --- a/lib/kickstart-deploy +++ b/lib/kickstart-deploy @@ -1,16 +1,20 @@ #!/bin/bash -e +[[ "$1" == "--sudo" ]] && prefix="sudo " && shift + target=$1 [ "$target" ] || echo "Please, provide an ssh target" shift +[[ "$1" == "--sudo" ]] && prefix="sudo " && shift + remote_command=$( cat <