Skip to content

Commit 6ccbadd

Browse files
committed
Option to install from slate dev branch
1 parent 5ef4524 commit 6ccbadd

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ Slate Installer commands:
3838
slate-installer install # creates a docs folder and installs latest slate into it
3939

4040
Options:
41-
-l, [--logo=LOGO] # path to custom logo file
41+
-l, [--logo=LOGO] # path to custom logo file
42+
-d, [--dev], [--no-dev] # install from the slate dev branch
4243

4344
Runtime options:
4445
-f, [--force] # Overwrite files that already exist
@@ -61,6 +62,12 @@ You can optionally specify the path to a custom logo to have that overwrite the
6162
$ slate-installer install -l path/to/logo.png
6263
```
6364

65+
You can optionally install slate from its dev branch instead of master with the `-d` option
66+
67+
```shell
68+
$ slate-installer install -d
69+
```
70+
6471
## Development
6572

6673
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

lib/slate/installer/cli.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ def self.source_paths
1717

1818
desc "install", "creates a docs folder and installs latest slate into it"
1919
method_option :logo, :type => :string, :aliases => "-l", :desc => "path to custom logo file", :lazy_default => ""
20+
method_option :dev, :type => :boolean, :aliases => "-d", :desc => "install from the slate dev branch"
2021
def install
2122
if options[:logo]
2223
logo = determine_logo_path(options[:logo])
2324
end
2425

2526
Dir.mktmpdir("slate-src-") do |tmpdir|
26-
output, _status = Open3.capture2e("git", "clone", "--depth", "1", "--progress", "https://github.com/lord/slate.git", tmpdir)
27+
branch = if options[:dev]
28+
"dev"
29+
else
30+
"master"
31+
end
32+
33+
output, _status = Open3.capture2e("git", "clone", "--depth", "1", "--branch", branch, "--progress", "https://github.com/lord/slate.git", tmpdir)
2734
puts output
2835

2936
if logo

0 commit comments

Comments
 (0)