UNPKG

sync-dotenv

Version:

Keep your .env in sync with .env.example

1 lines 1.38 kB
{"mappings":";AAoHA,QAAO,MAAM,wGAIV,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAiChD,CAAC;AC5GF,eAAe,OAAO,CAAC","sources":["lib/lib/lib.ts","lib/lib/index.ts","lib/index.ts"],"sourcesContent":[null,null,"#!/usr/bin/env node\n\nimport cp from \"child_process\";\nimport meow from \"meow\";\nimport { syncEnv } from \"./lib\";\n\nconst cli = meow(\n\t`\n\tUsage: sync-dotenv [options]\n\n\tOptions:\n\t\n\t-e, --env file .......... .env file location\n\t-s, --sample file ....... alternate sample env file to sync with\n\t-S, --samples \"file.*\" ........ alternate sample env files pattern to sync with\n\n\n\tNote: If options is omitted, sync-dotenv will attempt to sync .env \n\twith .env.example in the current working directory.\n\n\tExamples:\n\t\n\t$ sync-dotenv \n\t$ sync-dotenv --sample .env.development\n\t$ sync-dotenv --env server/.env --sample example.env\n\t$ sync-dotenv --samples \".env.*\"\n`,\n\t{\n\t\tflags: {\n\t\t\tsample: {\n\t\t\t\ttype: \"string\"\n\t\t\t}\n\t\t}\n\t}\n);\n\nconst { sample, s, env, e, samples, S } = cli.flags;\n\nsyncEnv(sample || s, env || e, samples || S)\n\t.then(sampleEnv => cp.exec(`git add ${sampleEnv}`))\n\t.catch(({ message, code }) => {\n\t\tconsole.log(message);\n\t\tprocess.exit(code);\n\t});\n\nexport default syncEnv;\n"],"names":[],"version":3,"file":"index.d.ts.map","sourceRoot":"../"}