Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup helper #107

Open
dhyegocalota opened this issue Jun 8, 2017 · 13 comments
Open

Startup helper #107

dhyegocalota opened this issue Jun 8, 2017 · 13 comments
Labels
🎉 feature request Baby steps! 🙏 help wanted With a little help from my friends...

Comments

@dhyegocalota
Copy link

dhyegocalota commented Jun 8, 2017

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 :)

@egordorichev
Copy link

It would be useful, if it writes those variable exports into ~/.bash_profile.

@dhyegocalota
Copy link
Author

@egordorichev exactly, that's the purporse

@egordorichev
Copy link

@dhyegofernando, it doesn't look like, it writes it somewhere. If you reboot, script changes will be reset.

@dhyegocalota
Copy link
Author

dhyegocalota commented Jun 8, 2017

@egordorichev yeah, it could be where it fits better for you, for me .zshrc was the target

@Garbee
Copy link
Contributor

Garbee commented Jun 8, 2017

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.

@mojoaxel mojoaxel added 🎉 feature request Baby steps! ⏳ pending-response What are you waiting for? Christmas? labels Mar 14, 2018
@mojoaxel
Copy link
Collaborator

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?

@dhyegocalota
Copy link
Author

Unfortunately I can't for a while 😞

@mojoaxel mojoaxel added 🙏 help wanted With a little help from my friends... and removed ⏳ pending-response What are you waiting for? Christmas? labels Mar 14, 2018
@ghost
Copy link

ghost commented May 21, 2018

Hey, I’d like to jump in on this. Should this be implemented in care.js directly, or in another file?

@ghost
Copy link

ghost commented May 21, 2018

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).

@Garbee
Copy link
Contributor

Garbee commented May 21, 2018

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.

@mojoaxel
Copy link
Collaborator

@ghost
Copy link

ghost commented May 22, 2018

@mojoaxel Thanks :) I’ve made CLIs before, I’m just AFK at the moment.

@ghost
Copy link

ghost commented May 23, 2018

ATM, I can’t even set up tiny-care-terminal on my machine. So, it’s gonna take a bit :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 feature request Baby steps! 🙏 help wanted With a little help from my friends...
Projects
None yet
Development

No branches or pull requests

4 participants