notwaldorf / tiny-care-terminal

💖💻 A little dashboard that tries to take care of you when you're using your terminal.
MIT License
5.96k stars 243 forks source link

Terminal doesn't display commits/Problems with git-standup #14

Closed DanielAndreasen closed 7 years ago

DanielAndreasen commented 7 years ago

Hi there, and thanks for this cool tool! 😄 I have set up everything, but I'm unable to see the git stuff. The problem for me is that standup-helper.sh is looking for git-standup in a place where it is not located. I installed git-standup with sudo npm install -g git-standup (maybe I should do this in another way). Any suggestions?

I also have problems with the fonts/emojis, but I can open another issue if you would like.

Someguy123 commented 7 years ago

Sadly I can't seem to get the GIT working either. I installed it via NPM, node version v6.3.1.

DanielAndreasen commented 7 years ago

I manage to get npm to install git-standup in the ~/node_modules folder*. If I run: ./standup-helper.sh /path/to/git/repos it works perfectly fine. If I run with sh standup-helper.sh ... it doesn't not work (this is how I think the JS is working).

* Uninstall npm, and install nvm instead. Use this to install node and npm can be used again. Now it can be used without sudo.

notwaldorf commented 7 years ago

Ugh, yeah, I don't really speak good node so I don't know how to get the path to git-standup from every kind of install. This is also why this doesn't work with yarn 😿

There's a PR out (#8) that I want to try to see if it fixes this, but since it still reaches into node_modules in the same way, it's probably going to solve a different problem, but not this one.

Any ideas welcome.

DanielAndreasen commented 7 years ago

Can't you just assume git-standup is in the PATH? Then you don't have to do this path trick.

shelldandy commented 7 years ago

Im having the same troubles maybe because I use fish-shell and I think the script assumes bash, so it is far easier just to assume git-standup is in the path and throw a message if it isn't

DanielAndreasen commented 7 years ago

@mike3run I tried running this in a bash shell, but with the same results. Hopefully PR #18 will resolve this.

shelldandy commented 7 years ago

@DanielAndreasen the author said yesterday she uses zsh with oh-my-zsh so yeah im guessing this only works now if you have your shell just like that 😝

DanielAndreasen commented 7 years ago

@mike3run I also use zsh, although not oh-my-zsh anymore. So that alone will not do the trick 😢

notwaldorf commented 7 years ago

I think this is about how your npm is installed, not about the shell you use -- for example, if you yarn install this, it doesn't work either.

Trying to look at the open PRs that fix this, but they don't work on my system yet :(

shelldandy commented 7 years ago

🤔 that could be, I have installed npm with nvm

And i think a great number of devs do that as well, do you have installed with homebrew @notwaldorf ?

notwaldorf commented 7 years ago

I have it installed with nvm and it works.

Hold on y'all, I've asked @zkat for help and I'll see what her fix is :)

notwaldorf commented 7 years ago

OK! I published 1.0.5 that maybe works better (edit: especially if you do npm install -g git-standup)? Anyone with a brokentiny-care-terminal` want to install that and tell me if it's better, pretty please? 🙏

zkat commented 7 years ago

Yeah there's not much to do here. There's an npm-exec thing we've been meaning to write for a while that would (hopefully, probably) allow all the path stuff to be configured the way npm scripts set up, but can't really just do it for bash scripts like this without going through npm run-script.

DanielAndreasen commented 7 years ago

@notwaldorf I have upgraded to version 1.0.7 and still doesn't work! But wait, when I run sh standup-helper.sh /some/path I get an error. However, if I run bash standup-helper.sh /some/path everything works fine. So I simple changed line 105 and 113 in care.js to use bash instead and all works! 😀

The error I get is:

standup-helper.sh: 11: standup-helper.sh: Syntax error: "(" unexpected

If I remove the usage function the problem is also solved. As the error says, I think you just use slightly wrong syntax error for sh, but for bash it is fine.

jackmransom commented 7 years ago

@DanielAndreasen There hasn't been a version bump yet, but @notwaldorf has merged my PR that fixes this syntax error. So the script (as it exists in the repo, at least) should now work with sh too! 😃

notwaldorf commented 7 years ago

Sorry y'all, had to sleep! 😅 Will tag a new release in an hour or so On Thu, Apr 20, 2017 at 9:33 AM Jack Ransom notifications@github.com wrote:

@DanielAndreasen https://github.com/DanielAndreasen There hasn't been a version bump yet, but @notwaldorf https://github.com/notwaldorf has merged my PR that fixes this syntax error. So the script (as it exists in the repo, at least) should now work with sh too! 😃

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/notwaldorf/tiny-care-terminal/issues/14#issuecomment-295803830, or mute the thread https://github.com/notifications/unsubscribe-auth/ABTkUv-nyVppk1RxTSsriShNPNop6_2uks5rx4jLgaJpZM4NAK0i .

DanielAndreasen commented 7 years ago

@jackmransom Ahh I see. Cool! :) @notwaldorf G'morning. Looking forward to the new version :)

notwaldorf commented 7 years ago

@jackmransom @DanielAndreasen 1.0.8 tagged! Let me know if it fixes your problems!

DanielAndreasen commented 7 years ago

It works perfectly :+1: At least for me. Only thing that is needed is a depth parameter for the git-standup, but I think this is already under development. Thank you very much :smiley:

darxtrix commented 7 years ago

For me not fixed 😞

Garbee commented 7 years ago

I use fish for my shell and it has worked fine here from initial install. I added instructions to the readme on setting the environment variables properly for the program to pick them up. So make sure they are being set right (you can confirm by running node and check the process.env output) and try the software again.

If anyone is still having problems with fish specifically, if you could open up an issue about what specifically isn't working focused on fish and mention me I'll take a look. I'd rather try and keep the shell-specific debugging separated from individual issues affecting everyone if @notwaldorf doesn't mind that.

cfjedimaster commented 7 years ago

I'm seeing this myself with Windows Bash. When I update tiny-care-terminal, I get the following issue:

npm WARN deprecated phantom@0.8.4: v1 is no longer maintained, please upgrade to v2.0+ as soon possible. npm WARN deprecated win-spawn@2.0.0: use cross-spawn or cross-spawn-async instead. npm WARN deprecated node-uuid@1.3.3: Use uuid module instead /usr/bin/tiny-care-terminal -> /usr/lib/node_modules/tiny-care-terminal/care.js /usr/lib ├── UNMET PEER DEPENDENCY git-standup@^2.1.8 └── tiny-care-terminal@1.0.8

I can install git-standup by itself though w/o error. I just uninstalled/reinstalled to be sure I had the latest, but yep, no git commits. Is there a way for me to debug to provide more information?

Garbee commented 7 years ago

git-standup is a peer dep so that needs to be installed by users as shown in the README (although the order is reversed so you're seeing the error.) The other warnings can be safely ignored, they're just warnings about some oudated/unmaintained software in use but that isn't affecting the usability.

Is your Windows Bash the "Ubuntu Bash On Windows" thing in Windows 10 or the git bash software distributed with git?

cfjedimaster commented 7 years ago

It's the Ubuntu Bash on Windows thing.

jackmransom commented 7 years ago

@cfjedimaster Silly question, I know, but do you have git installed in your Bash on Windows environment? git-standup will quite happily install without it but it'll fail at runtime.

If so, the output from running standup-helper.sh directly from a terminal would be helpful.

cfjedimaster commented 7 years ago

Yep, git works, and (since I didn't know what git-standup even did), I found it added 'standup' as an argument to Git, which I confirmed worked too.

Where would I find standup-helper.sh?

jackmransom commented 7 years ago

@cfjedimaster If you run npm list -g tiny-care-terminal it should give you the directory containing standup-helper.sh

cfjedimaster commented 7 years ago

Ok, I found it... but oddly I can't run it. I installed tiny-care-helper via sudo, so I tried to sudo ./standup-helper.sh from the directory, and it still can't find it.

jackmransom commented 7 years ago

@cfjedimaster How about running it as sh standup-helper.sh?

cfjedimaster commented 7 years ago

That works -I also changed it to a+x (which I realize is overkill), running it provides no output.

cfjedimaster commented 7 years ago

Ok, I figured out it takes a path as an arg. I ran:

sh standup-helper.sh /mnt/c/projects/raymondcamdendotcom

And it output:

Seems like Raymond Camden did nothing!
jackmransom commented 7 years ago

@cfjedimaster What about if you specify -d 7 as an arg?

cfjedimaster commented 7 years ago

It correctly reports my last set of commits.

curieos commented 7 years ago

I was able to get it to work if I changed care.js a little bit. I looked at the output of console.log(today); and saw that the spawnargs section had '/bin/sh', '-c', and 'sh /path/to/standup-helper.sh', missing the $TTC_REPOS paths

I changed the today line to: var today = spawn('sh ' + __dirname + '/standup-helper.sh ' + config.repos, [config.repos], {shell:true}); and the week line to a similar thing and it now works. It seems like the spawn function(?) isnt being called correctly? I'm not super familiar with js so I'm not 100% sure what is going on.

Garbee commented 7 years ago

That is JS calling a shell script. It works in some cases like that but not in others so the PR to make that spawn change was closed. PR #18 will probably handle these issues. So test it out please and see if it helps with your environments.

notwaldorf commented 7 years ago

As of version 1.2.0 there's a new way to use the terminal that doesn't involve the bash script, and should fix these probelms. To use that, set the TTC_GITBOT environment variable to gitlog. This will become the default way in the future, I'm just giving it a bit of time in the wild before switching to it

cfjedimaster commented 7 years ago

It works - thank you!