Commit 21749620 authored by Aral Balkan's avatar Aral Balkan
Browse files

Updated the Generator. Generated the codes for the initial launch. Added a...

Updated the Generator. Generated the codes for the initial launch. Added a readme into the codes folder so we have a label for these codes as we generate others in the future.
parent 627a623c
......@@ -5,12 +5,12 @@ fs = require 'fs'
class CodeGenerator
folder: null
folderExists: false
constructor: ->
# We put codes generated in each session into their own timestamped folder so we
# do not accidentally overwrite earlier ones
@folder = 'codes/' + Date.now()
fs.mkdirSync @folder
generateUniqueCodes: (numCodes) =>
......@@ -28,6 +28,10 @@ class CodeGenerator
codes = @generateUniqueCodes(numCodes)
if not @folderExists
fs.mkdirSync @folder
@folderExists = true
fileNameJSON = @folder + '/' + fileNameToSaveTo + '.json'
fs.writeFileSync fileNameJSON, JSON.stringify(codes)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment