This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new ec33853e Preserve args for relaunch
ec33853e is described below
commit ec33853eb4577eb04f6087740408d7f6607425ad
Author: Sebb <[email protected]>
AuthorDate: Wed Feb 28 00:03:30 2024 +0000
Preserve args for relaunch
---
tools/pubsub2rake.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/pubsub2rake.rb b/tools/pubsub2rake.rb
index ec2e7d6e..a630229f 100755
--- a/tools/pubsub2rake.rb
+++ b/tools/pubsub2rake.rb
@@ -106,10 +106,10 @@ if $0 == __FILE__
$misses = 0 # items not matched
options = {}
- options[:debug] = ARGV.delete('--debug')
- # Cannot use shift as ARGV is needed for a relaunch
- pubsub_URL = ARGV[0] || PUBSUB_URL
- pubsub_FILE = ARGV[1] || File.join(Dir.home, '.pubsub')
+ args = ARGV.dup # preserve ARGV for relaunch
+ options[:debug] = args.delete('--debug')
+ pubsub_URL = args[0] || PUBSUB_URL
+ pubsub_FILE = args[1] || File.join(Dir.home, '.pubsub')
pubsub_CRED = File.read(pubsub_FILE).chomp.split(':') rescue nil
WATCH = Hash.new{|h, k| h[k] = Array.new}