Skip to content

Instantly share code, notes, and snippets.

@YanhaoYang
Created July 7, 2014 14:44
Show Gist options
  • Save YanhaoYang/0f517abd5e0bbc4c3238 to your computer and use it in GitHub Desktop.
Save YanhaoYang/0f517abd5e0bbc4c3238 to your computer and use it in GitHub Desktop.
A script to scp file to a Vagrant box on OS X
#!/usr/bin/env bash
if [ -n "$1" ];
then
ssh_config=$(mktemp -t ssh_config)
vagrant ssh-config > "$ssh_config"
scp -F "$ssh_config" $@
else
echo "Usage: vagrant-scp [options] <file name> default:[the/path]"
fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment