Skip to content

Instantly share code, notes, and snippets.

@Darkle
Last active February 21, 2020 01:28
Show Gist options
  • Select an option

  • Save Darkle/eb7b423bdec0bf12b6345a0a4fd6a9a8 to your computer and use it in GitHub Desktop.

Select an option

Save Darkle/eb7b423bdec0bf12b6345a0a4fd6a9a8 to your computer and use it in GitHub Desktop.
cloneinside_func() {
node -p '
var repoUrl = "'"$1"'";
repoUrl = repoUrl.slice(0,-4) + "/archive/master.zip";
if(repoUrl.startsWith("git@github.com:")){
repoUrl = "https://github.com/" + repoUrl.slice(15)
};
var spawn = require("child_process").spawn;
spawn("wget " + repoUrl,{ stdio: "inherit", shell: true });' > /dev/null 2>&1
unzip -n ./master.zip -d ./cloneinside-tmp
cd cloneinside-tmp/*
rsync -r ./ ../../
cd ../..
rm -r cloneinside-tmp
rm ./master.zip
}
alias cloneinside=cloneinside_func original.conf my.co
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment