lib/lono/blueprint/new.rb in lono-5.2.5 vs lib/lono/blueprint/new.rb in lono-5.2.6
- old
+ new
@@ -71,10 +71,11 @@
# After this commands are executed with the newly created project
def set_destination_root
destination_root = "#{@cwd}/#{blueprint_name}"
self.destination_root = destination_root
+ @old_dir = Dir.pwd # for reset_current_dir
FileUtils.cd(self.destination_root)
end
def bundle_install
return if options[:from_new] || options[:import]
@@ -86,11 +87,11 @@
system("BUNDLE_IGNORE_CONFIG=1 bundle install")
end
end
def welcome_message
- return if options[:from_new]
+ return if options[:from_new] || options[:import]
puts <<~EOL
#{"="*64}
Congrats 🎉 You have successfully created a lono blueprint.
Cd into your blueprint and check things out.
@@ -108,12 +109,18 @@
tree_installed = system("type tree > /dev/null")
return unless tree_installed
structure = `tree .`
puts <<~EOL
- Here's the structure of your blueprint:
+ Here is the structure of your blueprint:
#{structure}
EOL
+ end
+
+ # Reason: So `lono code import` prints out the params values with relative paths
+ # when the config files are generated.
+ def reset_current_dir
+ FileUtils.cd(@old_dir)
end
end
end