tiny-care-terminal
tiny-care-terminal copied to clipboard
Startup helper
I've done a little shell script to put in my terminal's initial source file (.zshrc in my case):
# Tiny care terminal
export TTC_SAY_BOX="ironman"
export TTC_WEATHER="Várzea Grande, Brazil"
export TTC_GITBOT="gitlog"
function work() {
answer="Y"
if [[ -z "$1" || ("$1" != "-y" && "$1" != "-Y") ]]; then
echo -n "Wanna start work? (Y/n) "
read answer
fi
if [[ -z "$answer" || "$answer" = "Y" || "$answer" = "y" ]]; then
echo -n "Tell me some local git repos (separated by comma): "
read repos
ttc_repos=""
ifsbak=$IFS
IFS=","
for repo in `echo "$repos"`; do
if [[ "$ttc_repos" != "" ]]; then
ttc_repos="$ttc_repos,"
fi
ttc_repos="$ttc_repos$HOME/Projects/$repo"
done
IFS=$ifsbak
TTC_REPOS="$ttc_repos" tiny-care-terminal
else
echo "Ok, if you need me, just enter 'work'. See ya..."
fi
}
work
If it isn't helpful, please just close this issue. Regards :)
It would be useful, if it writes those variable exports into ~/.bash_profile.
@egordorichev exactly, that's the purporse
@dhyegofernando, it doesn't look like, it writes it somewhere. If you reboot, script changes will be reset.
@egordorichev yeah, it could be where it fits better for you, for me .zshrc
was the target
I think the script should be converted to node and store the vars in a way that can also be opened on Windows. That way we get cross-platform support.
I think the script should be converted to node and store the vars in a way that can also be opened on Windows
Maybe it's a good Idea to create something like a cli interface to ask for sime important settings and than start the app. @dhyegofernando Are you in the mood to create a RP?
Unfortunately I can't for a while 😞
Hey, I’d like to jump in on this. Should this be implemented in care.js directly, or in another file?
Looking at the codebase a little more: a possible check for configuration would be to check if there aren’t any twitter keys, but TTC_APIKEYS is true (which it is by default).
This would be it's own file. As @mojoaxel mentioned it would end up being a CLI front-end to help people get it configured.
Checking for config values is just pulling them from the node process environment. See if they exist, if not, ask for the user to provide them.
@moriczgergo Maybe this helps: https://blog.kentcdodds.com/tips-for-making-a-cli-based-tool-with-node-9903255c2a3b
@mojoaxel Thanks :) I’ve made CLIs before, I’m just AFK at the moment.
ATM, I can’t even set up tiny-care-terminal on my machine. So, it’s gonna take a bit :)