@@ -8,7 +8,7 @@ class Generate < Base
88
99 option "-f --force" , "Overwrite existing files"
1010 option "-w --wrap FUNCTION" , "Wrap the entire script in a function so it can also be sourced"
11- option "-q --quiet" , "Less verbose output "
11+ option "-q --quiet" , "Disable on-screen progress report "
1212
1313 environment "BASHLY_SOURCE_DIR" , "The path containing the bashly configuration and source files [default: src]"
1414 environment "BASHLY_TARGET_DIR" , "The path to use for creating the bash script [default: .]"
@@ -19,13 +19,17 @@ class Generate < Base
1919 def run
2020 create_user_files
2121 create_master_script
22- say "run !txtpur!#{ master_script_path } --help!txtrst! to test your bash script" unless args [ '--quiet' ]
22+ quiet_say "run !txtpur!#{ master_script_path } --help!txtrst! to test your bash script"
2323 end
2424
2525 private
2626
27+ def quiet_say ( message )
28+ say message unless args [ '--quiet' ]
29+ end
30+
2731 def create_user_files
28- say "creating user files in !txtgrn!#{ Settings . source_dir } " unless args [ '--quiet' ]
32+ quiet_say "creating user files in !txtgrn!#{ Settings . source_dir } "
2933
3034 create_file "#{ Settings . source_dir } /initialize.sh" , command . render ( :default_initialize_script )
3135
@@ -51,17 +55,17 @@ def create_all_command_files
5155
5256 def create_file ( file , content )
5357 if File . exist? file and !args [ '--force' ]
54- say "skipped !txtgrn!#{ file } !txtrst! (exists)" unless args [ '--quiet' ]
58+ quiet_say "skipped !txtgrn!#{ file } !txtrst! (exists)"
5559 else
5660 File . write file , content
57- say "created !txtgrn!#{ file } "
61+ quiet_say "created !txtgrn!#{ file } "
5862 end
5963 end
6064
6165 def create_master_script
6266 File . write master_script_path , script . code
6367 FileUtils . chmod "+x" , master_script_path
64- say "created !txtgrn!#{ master_script_path } " unless args [ '--quiet' ]
68+ quiet_say "created !txtgrn!#{ master_script_path } "
6569 end
6670
6771 def script
0 commit comments