diff --git a/README.md b/README.md index 8eda7e9..2a13225 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ my-app/ config/ development/ env.sh + exec.sh settings.json app/ client/ @@ -104,7 +105,7 @@ my-app/ $ iron run ``` -This will automatically load your config/development/env.sh and config/development/settings.json files. +This will automatically load your config/development/env.sh and config/development/settings.json files and run exec.sh as a shell script. ### Run the Application with a Different Environment diff --git a/lib/commands/run.js b/lib/commands/run.js index 909f947..f6d0d22 100644 --- a/lib/commands/run.js +++ b/lib/commands/run.js @@ -22,10 +22,15 @@ Command.create({ var configPath = this.pathFromProject('config', appEnv); var envPath = path.join(configPath, 'env.sh'); + var execPath = path.join(configPath, 'exec.sh'); var settingsPath = path.join(configPath, 'settings.json'); - // source the env file into the process environment + // Exec a shell script named exec.sh in configPath + if (this.isFile(execPath)) { + this.execSync('sh ' + execPath); + } + // source the env file into the process environment if (this.isFile(envPath)) { syncSource(envPath); } diff --git a/lib/templates/project/config/development/exec.sh b/lib/templates/project/config/development/exec.sh new file mode 100644 index 0000000..1a24852 --- /dev/null +++ b/lib/templates/project/config/development/exec.sh @@ -0,0 +1 @@ +#!/bin/sh