diff --git a/piku b/piku index 0b4a534..fceb6aa 100755 --- a/piku +++ b/piku @@ -52,6 +52,8 @@ else ssh -o LogLevel=QUIET ${sshflags} "$server" "$@" | grep -v "INTERNAL" echo " shell Local command to start an SSH session in the remote." echo " init Local command to download an example ENV and Procfile." + echo " download Local command to scp down a remote file. args: REMOTE-FILE(s) LOCAL-PATH" + echo " Remote file path is relative to the app folder." ;; apps|setup|setup:ssh|update) ssh ${sshflags} "$server" "$@" @@ -59,6 +61,9 @@ else shell) ssh -t "$server" run "$app" bash ;; + download) + scp "$server:~/.piku/apps/${app}/${2}" ${3:-'.'} + ;; *) shift # remove cmd arg ssh ${sshflags} "$server" "$cmd" "$app" "$@" diff --git a/piku.py b/piku.py index 84c52c4..cc8cb16 100755 --- a/piku.py +++ b/piku.py @@ -1649,6 +1649,13 @@ def cmd_git_upload_pack(app): call('git-shell -c "{}" '.format(argv[1] + " '{}'".format(app)), cwd=GIT_ROOT, shell=True) +@piku.command("scp", context_settings=dict(ignore_unknown_options=True, allow_extra_args=True)) +@pass_context +def cmd_scp(ctx): + """Simple wrapper to allow scp to work.""" + call(" ".join(["scp"] + ctx.args), cwd=GIT_ROOT, shell=True) + + def _get_plugin_commands(path): sys_path.append(abspath(path))