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

feat!: ability to choose temporary directory (#231) #232

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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,14 @@ Directory location to store test results in junit format and the device logs
cordova-paramedic --platform ios --plugin cordova-plugin-inappbrowser --outputDir /Users/sampleuser/testresults
```

#### `--tmpDir` (optional)

A path to a temporary directory where a project will be built. It points to a system temporary directory by default.

```shell
cordova-paramedic --platform ios --plugin cordova-plugin-inappbrowser --tmpDir ../tmp
```

#### `--cleanUpAfterRun` (optional)

Flag to indicate the sample application folder must be deleted.
Expand Down
2 changes: 1 addition & 1 deletion lib/ParamedicApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ParamedicApp {
}

createTempProject () {
this.tempFolder = tmp.dirSync();
this.tempFolder = tmp.dirSync({ tmpdir: this.config.getTmpDir() });
tmp.setGracefulCleanup();
logger.info('cordova-paramedic: creating temp project at ' + this.tempFolder.name);
exec(this.config.getCli() + ' create ' + this.tempFolder.name + utilities.PARAMEDIC_COMMON_CLI_ARGS);
Expand Down
9 changes: 9 additions & 0 deletions lib/ParamedicConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ class ParamedicConfig {
this._config.outputDir = outputDir;
}

getTmpDir () {
return this._config.tmpDir;
}

setTmpDir (tmpDir) {
this._config.tmpDir = tmpDir;
}

shouldCleanUpAfterRun () {
return this._config.cleanUpAfterRun;
}
Expand Down Expand Up @@ -293,6 +301,7 @@ ParamedicConfig.parseFromArguments = function (argv) {
endPort: argv.endport || argv.port,
externalServerUrl: argv.externalServerUrl,
outputDir: argv.outputDir ? argv.outputDir : null,
tmpDir: argv.tmpDir,
logMins: argv.logMins ? argv.logMins : null,
tccDb: argv.tccDbPath ? argv.tccDb : null,
cleanUpAfterRun: !!argv.cleanUpAfterRun,
Expand Down