From 3d9cd04b56d7a75b228d7bb037000b6c9b7f59e0 Mon Sep 17 00:00:00 2001 From: Michael Karlesky Date: Thu, 29 Aug 2024 12:23:02 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Resolved=20frozen=20ENV=20lookup?= =?UTF-8?q?=20string=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/projectinator.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/projectinator.rb b/bin/projectinator.rb index 35f74b9b..7e7bc221 100644 --- a/bin/projectinator.rb +++ b/bin/projectinator.rb @@ -26,15 +26,17 @@ class Projectinator def load(filepath:nil, env:{}, silent:false) # Highest priority: command line argument if filepath + @path_validator.standardize_paths( filepath ) _filepath = File.expand_path( filepath ) config = load_and_log( _filepath, 'from command line argument', silent ) return _filepath, config # Next priority: environment variable elsif env[PROJECT_FILEPATH_ENV_VAR] - filepath = env[PROJECT_FILEPATH_ENV_VAR] - _filepath = File.expand_path( filepath ) + # ENV lookup is frozen so dup() to operate on the string + filepath = env[PROJECT_FILEPATH_ENV_VAR].dup() @path_validator.standardize_paths( filepath ) + _filepath = File.expand_path( filepath ) config = load_and_log( _filepath, "from environment variable `#{PROJECT_FILEPATH_ENV_VAR}`",