lib/terraspace_bundler/mod/concerns/path_concern.rb
References a Google API hostAWS S3 object URL
SHA-25666e20ad06a78d9da0f2be3d6bc73af5ca3f684fbd1f7aaefb86b7fd0c0cffedb
MaleculeH₂(Cm₂F)
Evidence
1module TerraspaceBundler::Mod::Concerns
2 module PathConcern
3 def setup_tmp
4 FileUtils.mkdir_p(cache_root)
5 FileUtils.mkdir_p(stage_root)
6 end
7
8 def tmp_root
9 "/tmp/terraspace/bundler"
10 end
11
⋯6 lines
28:50… tly different folder.
29 # Also, Copy will use this and reference same method so it's consistent.
30 def rel_dest_dir
31 case @mod.type
32 when …
33:20… # example-module
34 when 's3'
35 path = type_path # https://s3-us-west-2.amazonaws.com/demo-terraform-test/example-module.zip
36 remove_ext(path) # demo-terraform-test/modules/example-module
37 when 'gcs'
38 path = type_path # https://www.googleapis.com/storage/v1/BUCKET_NAME/PATH/TO/module.zip
39 path.sub!(%r{storage/v\d+/},'')
40 remove_ext(path) # terraform-example- …
53:25… ') # removing leading slash to bucket name is the first thing
54 .sub(%r{//(.*)},'') # remove subfolder
55 end
56
57 def remove_ext(path)
58 …