-
-
Save fabiode/ee0d1613a39f5184f0fd0af98926f955 to your computer and use it in GitHub Desktop.
Cloud66 json substition for CX Toolbelt fast exchange between users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
file="$HOME/.cloud66/$1.json" | |
if [ -f "$file" ] | |
then | |
echo "$file found." | |
echo "erasing old cx.json, replacing for $1.json" | |
rm -rf "$HOME/.cloud66/cx.json" | |
ln -s $file "$HOME/.cloud66/cx.json" | |
else | |
echo "$file not found." | |
echo "You have these options below:" | |
ls_consult="$HOME/.cloud66/*.json" | |
ls $ls_consult | grep -v 'cx' | |
read -p "Choose one of the options, please: " FILENAME | |
new_file="$HOME/.cloud66/$FILENAME.json" | |
if [ -f "$new_file" ] | |
then | |
rm -rf "$HOME/.cloud66/cx.json" | |
ln -s $new_file "$HOME/.cloud66/cx.json" | |
echo "$new_file found." | |
echo "erasing old cx.json, replacing for $FILENAME.json" | |
else | |
echo "Not found. Try Again. =(" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment