Skip to content

Commit 564495a

Browse files
Dan Croakbmorrall
Dan Croak
authored andcommitted
Switch from hub to gh
[gh] is a [hub] reimplementation that's much faster and is now the official Github CLI. It appears that "hub" is [deprecated]. [gh]: https://github.com/jingweno/gh [hub]: https://github.com/github/hub [deprecated]: mislav/hub#475
1 parent c57634b commit 564495a

File tree

9 files changed

+39
-13
lines changed

9 files changed

+39
-13
lines changed

Manifest.mac

-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ common-components/ruby-environment
1515
mac-components/bundler
1616
common-components/default-gems
1717
mac-components/heroku
18-
mac-components/github
1918
mac-components/rcm
2019
common-components/personal-additions

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ What it sets up
5454
* [Bundler] for managing Ruby libraries
5555
* [Exuberant Ctags] for indexing files for vim tab completion
5656
* [Foreman] for serving Rails apps locally
57+
* [gh] for interacting with the GitHub API
5758
* [Heroku Config] for local `ENV` variables
5859
* [Heroku Toolbelt] for interacting with the Heroku API
59-
* [Hub] for interacting with the GitHub API
6060
* [Homebrew] for managing operating system libraries (OS X only)
6161
* [ImageMagick] for cropping and resizing images
6262
* [Node.js] and [NPM], for running apps and installing JavaScript packages
@@ -77,9 +77,9 @@ What it sets up
7777
[Bundler]: http://bundler.io/
7878
[Exuberant Ctags]: http://ctags.sourceforge.net/
7979
[Foreman]: https://github.com/ddollar/foreman
80+
[gh]: https://github.com/jingweno/gh
8081
[Heroku Config]: https://github.com/ddollar/heroku-config
8182
[Heroku Toolbelt]: https://toolbelt.heroku.com/
82-
[Hub]: https://hub.github.com/
8383
[Homebrew]: http://brew.sh/
8484
[ImageMagick]: http://www.imagemagick.org/
8585
[Node.js]: http://nodejs.org/

lib/distro.rb

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ def silver_searcher_test
6363
run_vagrant_ssh_command('command -v ag')
6464
end
6565

66+
def gh_test
67+
run_vagrant_ssh_command('command -v gh')
68+
end
69+
6670
def package
6771
run_vagrant_ssh_command('rm -Rf ~/test_app')
6872
run_vagrant_ssh_command('sudo aptitude clean')

linux

+13-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,19 @@ fancy_echo "Installing the heroku-config plugin to pull config variables locally
179179
### end linux-components/heroku
180180

181181
fancy_echo "Installing GitHub CLI client ..."
182-
curl http://hub.github.com/standalone -sLo ~/.bin/hub
183-
chmod +x ~/.bin/hub
182+
version="$(curl https://github.com/jingweno/gh/releases/latest -s | cut -d'v' -f2 | cut -d'"' -f1)"
183+
184+
if uname -m | grep -Fq 'x86_64'; then
185+
arch='amd64'
186+
else
187+
arch='i386'
188+
fi
189+
190+
cd /tmp
191+
url="https://github.com/jingweno/gh/releases/download/v${version}/gh_${version}_${arch}.deb"
192+
curl "$url" -sLo gh.deb
193+
sudo dpkg -i gh.deb
194+
cd -
184195
### end linux-components/github
185196

186197
fancy_echo "Installing rcm, to manage your dotfiles ..."

linux-components/github

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
fancy_echo "Installing GitHub CLI client ..."
2-
curl http://hub.github.com/standalone -sLo ~/.bin/hub
3-
chmod +x ~/.bin/hub
2+
version="$(curl https://github.com/jingweno/gh/releases/latest -s | cut -d'v' -f2 | cut -d'"' -f1)"
3+
4+
if uname -m | grep -Fq 'x86_64'; then
5+
arch='amd64'
6+
else
7+
arch='i386'
8+
fi
9+
10+
cd /tmp
11+
url="https://github.com/jingweno/gh/releases/download/v${version}/gh_${version}_${arch}.deb"
12+
curl "$url" -sLo gh.deb
13+
sudo dpkg -i gh.deb
14+
cd -

mac

+3-4
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ fancy_echo "Installing QT, used by Capybara Webkit for headless Javascript integ
132132
fancy_echo "Installing watch, to execute a program periodically and show the output ..."
133133
brew_install_or_upgrade 'watch'
134134

135+
fancy_echo "Installing GitHub CLI client ..."
136+
brew_install_or_upgrade 'gh'
137+
135138
node_version="0.10"
136139

137140
fancy_echo "Installing NVM, Node.js, and NPM, for running apps and installing JavaScript packages ..."
@@ -218,10 +221,6 @@ fancy_echo "Installing foreman ..."
218221
sudo installer -pkg /tmp/foreman.pkg -tgt /
219222
### end mac-components/heroku
220223

221-
fancy_echo "Installing GitHub CLI client ..."
222-
brew_install_or_upgrade 'hub'
223-
### end mac-components/github
224-
225224
if ! command -v rcup >/dev/null; then
226225
fancy_echo "Installing rcm, to manage your dotfiles ..."
227226
brew tap thoughtbot/formulae

mac-components/github

-2
This file was deleted.

mac-components/packages

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ fancy_echo "Installing QT, used by Capybara Webkit for headless Javascript integ
2828
fancy_echo "Installing watch, to execute a program periodically and show the output ..."
2929
brew_install_or_upgrade 'watch'
3030

31+
fancy_echo "Installing GitHub CLI client ..."
32+
brew_install_or_upgrade 'gh'
33+
3134
node_version="0.10"
3235

3336
fancy_echo "Installing NVM, Node.js, and NPM, for running apps and installing JavaScript packages ..."

spec/laptop_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
expect { distro.scaffold_and_model_generation }.not_to raise_error
3131
expect { distro.database_migration }.not_to raise_error
3232
expect { distro.silver_searcher_test }.not_to raise_error
33+
expect { distro.gh_test }.not_to raise_error
3334

3435
puts "Packaging box for distribution"
3536

0 commit comments

Comments
 (0)