From 0a09911132f527c86d3b29bfcb309e8dc4eda0e4 Mon Sep 17 00:00:00 2001 From: Katja Date: Wed, 4 Sep 2024 16:58:34 -0700 Subject: [PATCH] update release_dir --- lib/egads/command/extract.rb | 7 ++++++- lib/egads/command/release.rb | 8 +++++--- lib/egads/command/stage.rb | 8 +++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/egads/command/extract.rb b/lib/egads/command/extract.rb index dec7acd..a6ddec0 100644 --- a/lib/egads/command/extract.rb +++ b/lib/egads/command/extract.rb @@ -89,7 +89,12 @@ def do_extract(path) # Directory created upon successful extraction def release_dir - RemoteConfig.release_dir(sha) + base_dir = RemoteConfig.release_dir(sha) + if options[:deployment_id] + deployment_id_value = deployment_id + return "#{base_dir}_#{deployment_id_value}" if deployment_id_value + end + base_dir end # Directory where in-progress extraction occurs diff --git a/lib/egads/command/release.rb b/lib/egads/command/release.rb index 0a2c541..60b330f 100644 --- a/lib/egads/command/release.rb +++ b/lib/egads/command/release.rb @@ -57,9 +57,11 @@ def trim def dir base_dir = RemoteConfig.release_dir(sha) - deployment_id_value = deployment_id if options[:deployment_id] - - deployment_id_value ? "#{base_dir}_#{deployment_id_value}" : base_dir + if options[:deployment_id] + deployment_id_value = deployment_id + return "#{base_dir}_#{deployment_id_value}" if deployment_id_value + end + base_dir end def release_to diff --git a/lib/egads/command/stage.rb b/lib/egads/command/stage.rb index 7716c6a..29034b8 100644 --- a/lib/egads/command/stage.rb +++ b/lib/egads/command/stage.rb @@ -69,9 +69,11 @@ def mark_as_staged def dir base_dir = RemoteConfig.release_dir(sha) - deployment_id_value = deployment_id if options[:deployment_id] - - deployment_id_value ? "#{base_dir}_#{deployment_id_value}" : base_dir + if options[:deployment_id] + deployment_id_value = deployment_id + return "#{base_dir}_#{deployment_id_value}" if deployment_id_value + end + base_dir end def stage_flag_path