Sha256: 71d02f31c317166022aa0c8792e69fb31e18e8dac9997483fc36eda3fef6dc10

Contents?: true

Size: 362 Bytes

Versions: 9

Compression:

Stored size: 362 Bytes

Contents

# helper to build the add VAR cmd
def build_add_var_cmd(vars_file, key, value)
  puts "#{vars_file} #{key} #{value}"
  cmd = "if awk < #{vars_file} -F= '{print $1}' | grep --quiet -w #{key}; then "
  cmd += "sed -i 's/^#{key}=.*/#{key}=#{value.gsub("\/", "\\/")}/g' #{vars_file};"
  cmd += "else echo '#{key}=#{value}' >> #{vars_file};"
  cmd += "fi"
  cmd
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
negroku-2.0.3 lib/negroku/helpers/env.rb
negroku-2.0.2 lib/negroku/helpers/env.rb
negroku-2.0.1 lib/negroku/helpers/env.rb
negroku-2.0.0 lib/negroku/helpers/env.rb
negroku-2.0.0.pre7 lib/negroku/helpers/env.rb
negroku-2.0.0.pre6 lib/negroku/helpers/env.rb
negroku-2.0.0.pre5 lib/negroku/helpers/env.rb
negroku-2.0.0.pre4 lib/negroku/helpers/env.rb
negroku-2.0.0.pre3 lib/negroku/helpers/env.rb