File tree Expand file tree Collapse file tree 8 files changed +45
-1
lines changed
fixtures/workspaces/custom-paths Expand file tree Collapse file tree 8 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,11 @@ def config
8787 end
8888
8989 def user_settings
90- @user_settings ||= File . exist? ( 'settings.yml' ) ? Config . new ( 'settings.yml' ) : { }
90+ @user_settings ||= File . exist? ( user_settings_path ) ? Config . new ( user_settings_path ) : { }
91+ end
92+
93+ def user_settings_path
94+ ENV [ 'BASHLY_SETTINGS_PATH' ] || 'settings.yml'
9195 end
9296
9397 def defsult_settings
Original file line number Diff line number Diff line change 55# When setting environment variables, you can use:
66# - "0", "false" or "no" to represent false
77# - "1", "true" or "yes" to represent true
8+ #
9+ # If you wish to change the path to this file, set the environment variable
10+ # BASHLY_SETTINGS_PATH.
811
912# The path containing the bashly source files
1013source_dir : src
Original file line number Diff line number Diff line change 1+ creating user files in src
2+ created src/initialize.sh
3+ created src/root_command.sh
4+ created ./cli
5+ run ./cli --help to test your bash script
6+ + ./cli -h
7+ cli - Custom paths
8+
9+ Usage:
10+ cli
11+ cli --help | -h
12+ cli --version | -v
13+
14+ Options:
15+ --help, -h
16+ Show this help
17+
18+ --version, -v
19+ Show version number
20+
Original file line number Diff line number Diff line change 1+ cli
2+ src /* .sh
Original file line number Diff line number Diff line change 1+ Tests custom paths for settings.yml and bashly.yml
Original file line number Diff line number Diff line change 1+ name : cli
2+ help : Custom paths
3+ version : 0.1.0
Original file line number Diff line number Diff line change 1+ config_path : my-bashly.yml
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ rm -f cli
4+ rm -f src/* .sh
5+
6+ BASHLY_SETTINGS_PATH=my-settings.yml bundle exec bashly generate
7+
8+ set -x
9+
10+ ./cli -h
You can’t perform that action at this time.
0 commit comments