mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-05 22:31:11 +08:00
Added configuration file paths and improved messages
This commit is contained in:
parent
433c24e710
commit
654dbfca62
@ -46,8 +46,12 @@ module YouPlot
|
|||||||
paths << ENV['MYYOUPLOTRC'] if ENV['MYYOUPLOTRC']
|
paths << ENV['MYYOUPLOTRC'] if ENV['MYYOUPLOTRC']
|
||||||
paths << '.youplot.yml'
|
paths << '.youplot.yml'
|
||||||
paths << '.youplotrc'
|
paths << '.youplotrc'
|
||||||
paths << File.join(ENV['HOME'], '.youplotrc') if ENV['HOME']
|
if ENV['HOME']
|
||||||
paths << File.join(ENV['HOME'], '.youplot.yml') if ENV['HOME']
|
paths << File.join(ENV['HOME'], '.youplotrc')
|
||||||
|
paths << File.join(ENV['HOME'], '.youplot.yml')
|
||||||
|
paths << File.join(ENV['HOME'], '.config', 'youplot', 'youplotrc')
|
||||||
|
paths << File.join(ENV['HOME'], '.config', 'youplot', 'youplot.yml')
|
||||||
|
end
|
||||||
paths
|
paths
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -217,12 +221,13 @@ module YouPlot
|
|||||||
puts config.inspect
|
puts config.inspect
|
||||||
else
|
else
|
||||||
puts <<~EOS
|
puts <<~EOS
|
||||||
You don't have a config file. The default config file paths are:
|
Configuration file not found.
|
||||||
./.youplot.yml, ./.youplotrc, ~/.youplot.yml, ~/.youplotrc
|
It should be a YAML file, like this example:
|
||||||
You can specify a config file with the environment variable MYYOUPLOTRC.
|
width : 40
|
||||||
File format is YAML. For example:
|
height : 20
|
||||||
width : 40
|
By default, YouPlot will look for the configuration file in these locations:
|
||||||
height : 20
|
#{config_file_candidate_paths.map { |s| ' ' + s }.join("\n")}
|
||||||
|
If you have the file elsewhere, you can specify its location with the `MYYOUPLOTRC` environment variable..
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
exit if YouPlot.run_as_executable?
|
exit if YouPlot.run_as_executable?
|
||||||
|
Loading…
Reference in New Issue
Block a user