Created
June 11, 2021 23:17
-
-
Save rvause/ba34b97fbb7274c1373a29ca91ac37f0 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env sh | |
# Simple script to switch Neocities configs for the CLI. | |
# Save tokens by copying "config" file to "config.<name>". | |
# Then use <name> to switch to that config. | |
# For example: | |
# $ mv ~/.config/neocities/config ~/.config/neocities/config.mysite | |
# | |
# With that in place you can now switch to it: | |
# $ neocities-switch mysite | |
# | |
# Repeat by logging in again and copying configs as many times you need | |
# to set up configs to switch to. | |
cp ~/.config/neocities/config.$1 ~/.config/neocities/config | |
if neocities list / | grep index.html > /dev/null 2>&1; then | |
echo "Switched to $1" | |
else | |
echo "Failed to authenticate $1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment