-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Fix bitters cli with custom path #191
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,12 @@ def install | |
puts "Bitters files already installed, doing nothing." | ||
else | ||
install_files | ||
puts "Bitters files installed to #{install_path}/base" | ||
puts "Bitters files installed to #{install_path}/" | ||
end | ||
end | ||
|
||
desc 'reset', 'Reset Bitters' | ||
method_options path: :string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is this used in the code? Can you add tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line isn't used by Bitters itself but would be called if a user runs
I can add some specs for the whole generator code if you think it's necessary. I'll do it then for Bourbon and Neat too (if thoughtbot/neat#329 got merged). |
||
def reset | ||
if bitters_files_already_exist? | ||
remove_bitters_directory | ||
|
@@ -32,6 +33,7 @@ def reset | |
end | ||
|
||
desc 'remove', 'Remove Bitters' | ||
method_options path: :string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is this used in the code? Can you add tests? |
||
def remove | ||
if bitters_files_already_exist? | ||
remove_bitters_directory | ||
|
@@ -62,7 +64,7 @@ def install_files | |
end | ||
|
||
def remove_bitters_directory | ||
FileUtils.rm_rf("base") | ||
FileUtils.rm_rf(install_path) | ||
end | ||
|
||
def all_stylesheets | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not write to stdout. Use Rails' logger if you want to log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not in rails, so this is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove the trailing slash, if you specify the path to be
custom_path/
it will be printed as...installed to custom_path//
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, as the path would be
custom_path/base
, due tobitters/lib/bitters/generator.rb
Line 56 in 8e00402
This diff line (from the 2nd commit), only fixes the CLI output when running for example
bitters install --path foo
. It outputsBitters files installed to foo/base/base
when it should showfoo/base
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense