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

Improve error message if git not in path #57

Closed
rajsite opened this issue May 8, 2016 · 5 comments
Closed

Improve error message if git not in path #57

rajsite opened this issue May 8, 2016 · 5 comments

Comments

@rajsite
Copy link

rajsite commented May 8, 2016

On a windows box that does not have git on the path (standard github desktop install), running jekyll build resulted in the following error:

D:\github\rajsite.github.io>jekyll build
Configuration file: D:/github/rajsite.github.io/_config.yml
            Source: D:/github/rajsite.github.io
       Destination: D:/github/rajsite.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
jekyll 3.0.5 | Error:  No such file or directory - git remote --verbose

Adding the verbose flag gave a little more context

D:\github\rajsite.github.io>jekyll build --verbose
  Logging at level: debug
Configuration file: D:/github/rajsite.github.io/_config.yml
      GitHub Pages: github-pages v78
      GitHub Pages: jekyll v3.0.5
     PluginManager: Requiring jekyll-paginate
     PluginManager: Requiring jekyll-coffeescript
     PluginManager: Requiring jekyll-gist
     PluginManager: Requiring jekyll-github-metadata
            Source: D:/github/rajsite.github.io
       Destination: D:/github/rajsite.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
           Reading: _posts/2016-03-08-example-post.md
           Reading: _posts/2016-03-13-my-new-post.md
         Generator: Calling GHPMetadataGenerator
jekyll 3.0.5 | Error:  No such file or directory - git remote --verbose

Some light Googling landed here:

# Public: fetches the repository name with owner to fetch metadata for.
# In order of precedence, this method uses:
# 1. the environment variable $PAGES_REPO_NWO
# 2. 'repository' variable in the site config
# 3. the 'origin' git remote's URL
#
# site - the Jekyll::Site being processed
#
# Return the name with owner (e.g. 'parkr/my-repo') or raises an
# error if one cannot be found.

And the going back to the project root I saw the ability to add repository: username/repo-name to config and all was well: https://github.com/jekyll/github-metadata/tree/4b94b3693ca40ae3583e7f3e389e6d83e35e66b7#usage

A nicer error message may have saved a few steps :)

@benbalter
Copy link
Contributor

I've used https://github.com/yaauie/cliver which works well, if we don't mind adding a dependency.

@parkr
Copy link
Member

parkr commented May 9, 2016

@benbalter Alternatively, we could add a has_git? check which does a system("git status") or something else innocuous and only checks the git remote at that point. If the system doesn't have git and now nwo is found, then our work in #52 should help alleviate potential warnings associated with a lack of nwo.

@benbalter
Copy link
Contributor

Makes sense. Know that you're the dependency police. Cliver basically does that, and generally makes more sense when it's a hard, rather than optional dependency.

@parkr parkr closed this as completed in 9d3ee78 Jun 3, 2016
@parkr
Copy link
Member

parkr commented Jun 3, 2016

Totally meant to make a PR but forgot to create a branch first... Welp.

Fixed! Thanks. 😄

parkr added a commit that referenced this issue Jun 3, 2016
@rajsite
Copy link
Author

rajsite commented Jun 26, 2016

The update looks good when just running jekyll build. Thank you for that! 😄

Unfortunately, now I see an error occur when jekyll build --watch is used and git is not on the path. What is interesting is that the initial build succeeds. A file modification resulting in a second build succeeds. All modifications after the second cause a failure until the process is stopped and started again.

D:\Dropbox\dev\rajsite.com\src>jekyll build --verbose --watch
  Logging at level: debug
Configuration file: D:/Dropbox/dev/rajsite.com/src/_config.yml
      GitHub Pages: github-pages v84
      GitHub Pages: jekyll v3.1.6
         Requiring: jekyll-coffeescript
         Requiring: jekyll-gist
         Requiring: jekyll-github-metadata
         Requiring: jekyll-paginate
         Requiring: kramdown
            Source: D:/Dropbox/dev/rajsite.com/src
       Destination: D:/Dropbox/dev/rajsite.com/src/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       EntryFilter: excluded /CNAME
       EntryFilter: excluded /Gemfile
       EntryFilter: excluded /Gemfile.lock
       EntryFilter: excluded /LICENSE
       EntryFilter: excluded /node_modules
       EntryFilter: excluded /package.json
       EntryFilter: excluded /README.md
           Reading: _posts/2016-06-25-scraping-web-pages-in-labview.md
   GitHub Metadata: Initializing...
         Rendering: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Pre-Render Hooks: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Rendering Liquid: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Rendering Markup: _posts/2016-06-25-scraping-web-pages-in-labview.md
         Requiring: kramdown
  Rendering Layout: _posts/2016-06-25-scraping-web-pages-in-labview.md
         Rendering: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Pre-Render Hooks: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Rendering Liquid: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Rendering Markup: _posts/2016-06-25-scraping-web-pages-in-labview.md
         Rendering: about.md
  Pre-Render Hooks: about.md
  Rendering Liquid: about.md
  Rendering Markup: about.md
  Rendering Layout: about.md
         Rendering: index.html
  Pre-Render Hooks: index.html
  Rendering Liquid: index.html
  Rendering Markup: index.html
  Rendering Layout: index.html
                    done in 0.477 seconds.
         Requiring: jekyll-watch
      GitHub Pages: github-pages v84
      GitHub Pages: jekyll v3.1.6
         Requiring: jekyll-coffeescript
         Requiring: jekyll-gist
         Requiring: jekyll-github-metadata
         Requiring: jekyll-paginate
         Requiring: kramdown
           Watcher: Ignoring (?-mix:_config\.yml)
           Watcher: Ignoring (?-mix:_site)
           Watcher: Ignoring (?-mix:CNAME)
           Watcher: Ignoring (?-mix:Gemfile)
           Watcher: Ignoring (?-mix:Gemfile\.lock)
           Watcher: Ignoring (?-mix:LICENSE)
           Watcher: Ignoring (?-mix:README\.md)
           Watcher: Ignoring (?-mix:package\.json)
           Watcher: Ignoring (?-mix:node_modules)
 Auto-regeneration: enabled for 'D:/Dropbox/dev/rajsite.com/src'
      Regenerating: 1 file(s) changed at 2016-06-26 03:44:21        EntryFilter: excluded /CNAME
       EntryFilter: excluded /Gemfile
       EntryFilter: excluded /Gemfile.lock
       EntryFilter: excluded /LICENSE
       EntryFilter: excluded /node_modules
       EntryFilter: excluded /package.json
       EntryFilter: excluded /README.md
           Reading: _posts/2016-06-25-scraping-web-pages-in-labview.md
   GitHub Metadata: Initializing...
         Rendering: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Pre-Render Hooks: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Rendering Liquid: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Rendering Markup: _posts/2016-06-25-scraping-web-pages-in-labview.md
         Requiring: kramdown
  Rendering Layout: _posts/2016-06-25-scraping-web-pages-in-labview.md
         Rendering: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Pre-Render Hooks: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Rendering Liquid: _posts/2016-06-25-scraping-web-pages-in-labview.md
  Rendering Markup: _posts/2016-06-25-scraping-web-pages-in-labview.md
         Rendering: about.md
  Pre-Render Hooks: about.md
  Rendering Liquid: about.md
  Rendering Markup: about.md
  Rendering Layout: about.md
         Rendering: index.html
  Pre-Render Hooks: index.html
  Rendering Liquid: index.html
  Rendering Markup: index.html
  Rendering Layout: index.html
...done in 0.29122 seconds.
      Regenerating: 1 file(s) changed at 2016-06-26 03:44:23        EntryFilter: excluded /CNAME
       EntryFilter: excluded /Gemfile
       EntryFilter: excluded /Gemfile.lock
       EntryFilter: excluded /LICENSE
       EntryFilter: excluded /node_modules
       EntryFilter: excluded /package.json
       EntryFilter: excluded /README.md
           Reading: _posts/2016-06-25-scraping-web-pages-in-labview.md
   GitHub Metadata: Initializing...
...error:
             Error: No such file or directory - git rev-parse HEAD
             Error: Run jekyll build --trace for more information.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants