Skip to content

Commit b402d38

Browse files
committed
Add environment to create_key script
1 parent 767a921 commit b402d38

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/create_key

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ require "code0/license"
77
# Generate a key pair. You should do this only once.
88
key_pair = OpenSSL::PKey::RSA.generate(4096)
99

10+
environment = ARGV.shift || 'test'
11+
1012
# Write it to a file to use in the license generation application.
11-
File.write("keys/license_encryption_key_test.key", key_pair.to_pem)
13+
File.write("keys/license_encryption_key_#{environment}.key", key_pair.to_pem)
1214

1315
# Extract the public key.
1416
public_key = key_pair.public_key
1517
# Write it to a file to ship along with the main application.
16-
File.write("keys/license_encryption_key_test.pub", public_key.to_pem)
18+
File.write("keys/license_encryption_key_#{environment}.pub", public_key.to_pem)

0 commit comments

Comments
 (0)