Skip to content

Conversation

@daipom
Copy link
Contributor

@daipom daipom commented Sep 29, 2025

We need to specify top_dir as an argument, but it is unclear now.

Before

$ ruby make-install-script.rb --help
Usage: make-install-script [options]
    -a, --archive                    Enable archived installed script to verify with
    -b, --backup                     Backup original install script (e.g. https://toolbelt.treasuredata.com)
    -c, --channel TARGET_CHANNEL     Specify channel with comma separated (e.g. --channel 4,5)
    -d, --debug                      Enable debug logging
    -s, --site URL                   Specify distribution site (e.g. https://fluentd.cdn.cncf.io)
    -v, --verify                     Enable verification mode

After

$ ruby make-install-script.rb --help
Usage: ruby make-install-script.rb [options] top-dir
    -a, --archive                    Enable archived installed script to verify with
    -b, --backup                     Backup original install script (e.g. https://toolbelt.treasuredata.com)
    -c, --channel TARGET_CHANNEL     Specify channel with comma separated (e.g. --channel 4,5)
    -d, --debug                      Enable debug logging
    -s, --site URL                   Specify distribution site (e.g. https://fluentd.cdn.cncf.io)
    -v, --verify                     Enable verification mode

@kenhys
Copy link
Collaborator

kenhys commented Sep 29, 2025

Another idea: by default, assume top directory was specified.

diff --git a/make-install-script.rb b/make-install-script.rb
index dd1c113..b36e5fe 100644
--- a/make-install-script.rb
+++ b/make-install-script.rb
@@ -38,9 +38,8 @@ opt.on("-s", "--site URL", "Specify distribution site (e.g. https://fluentd.cdn.
 opt.on("-v", "--verify", "Enable verification mode") { options[:verify] = true }
 top_dir = opt.parse!(ARGV).first
 
-unless File.exist?(top_dir)
-  puts "#{top_dir} not found"
-  exit 1
+unless top_dir
+  top_dir = File.dirname(File.expand_path(__FILE__))
 end
 
 class FluentInstallScript

@daipom
Copy link
Contributor Author

daipom commented Sep 29, 2025

I see! Looks good!

@daipom
Copy link
Contributor Author

daipom commented Sep 29, 2025

Okay, let's go with that approach.
I close this PR now.

@daipom daipom closed this Sep 29, 2025
@daipom daipom deleted the make-install-script-add-guide-top_dir branch September 29, 2025 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants