@37bytes/prepare-environment

2.0.0 • Public • Published

Usage

  1. prepare-environment ENV_NAME=stage In this case app looking for .environmentrc automatically. The file must be located in the root.

  2. prepare-environment ENV_NAME=stage CONFIG_PATH=configs/.environmentrc
    In this case app get .environmentrc file from the custom path.

Optional parameters default values

  • CONFIG_PATH = /,

Local developing

  1. create ./environments/.env.stage (env file must match ENV_NAME=stage)
  2. ts-node src/index.ts <...>
  3. npm run build&watch; node build/index.js <...>
  4. npm run build; chmod +x build/index.js; npm link; prepare-environment <...>
  5. example: ts-node src/index.ts CONFIG_PATH=__fixtures__/.environmentrc ENV_NAME=stage

version history

2.0.0

  • Elimination of allowedEnvironments. Instead, available environments are computed from the environments folder.
  • Added 'isEnvironmentExists' function in utils. The function takes parameters: targetEnvironment - the name of the environment, and pathToEnvironmentsFolder - the path to the folder containing the environments. The function checks for the presence of the .env.targetEnvironment file in the environments folder.
  • fix for environment name check

1.0.4

  • refactoring the script version

1.0.3

  • refactoring utils and main script

1.0.2

  • update .npmignore

1.0.1

  • fix small bugs

1.0.0

  • first version

/@37bytes/prepare-environment/

    Package Sidebar

    Install

    npm i @37bytes/prepare-environment

    Weekly Downloads

    43

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    16.5 kB

    Total Files

    12

    Last publish

    Collaborators

    • arhonist-37b
    • rispaev
    • yar_vav
    • rteslenko
    • tnikolaeva
    • dc.nikolaev
    • mgarmash