Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a file to exec shell scripts #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ my-app/
config/
development/
env.sh
exec.sh
settings.json
app/
client/
Expand Down Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion lib/commands/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions lib/templates/project/config/development/exec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/sh