Skip to content

Commit

Permalink
Merge 62ba8d9 into 1f97945
Browse files Browse the repository at this point in the history
  • Loading branch information
dustxd committed Oct 8, 2020
2 parents 1f97945 + 62ba8d9 commit e95fdac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ The FRAU appconfig builder can be run either directly on the console CLI (assumi
Typical configuration for running in [TRAVIS](https://magnum.travis-ci.com/):

```javascript
frau-appconfig-builder --dist|-d ./dist
frau-appconfig-builder --dist|-d ./dist
--appfile|-f app.js
--loader|-l umd
--envvar|-e TRAVIS
--showloading|-s
--showloading|-s
--oslo|-o oslo/langterms/
+ local appresolver options
+ publisher options
```
Expand Down Expand Up @@ -90,7 +91,7 @@ builder.buildStream(target)
- `envVar` (optional) - The environment variable for checking to determine the build environment (local vs. remote), necessary to resolve app end-point
- `loader` (optional) - The app loader type to be specified in the `appconfig.json`, controls how the FRA will be loaded (ex. umd, iframe, html)
- `showLoading` (optional umd) - Whether to show the loading indicator when using the umd loader. The defaults to false.
- `oslo` (optional) - The oslo translation xml language terms path (ex. oslo/langterms/)
## Contributing
Contributions are welcome, please submit a pull request!
Expand Down
7 changes: 7 additions & 0 deletions bin/appconfigbuildercli
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ argv = argv.usage('Usage: frau-appconfig-builder [--appfile|-f] [--dist|-d] [--l
.alias('l', 'loader')
.alias('e', 'envvar')
.alias('s', 'showloading')
.alias('o', 'oslo')
.argv;

var opts = {
Expand All @@ -21,6 +22,8 @@ var opts = {
showLoading: ( (argv.showloading || process.env.npm_package_config_frauAppConfigBuilder_showLoading === 'true') ? true : false)
};

var oslo = (argv.oslo || process.env.npm_package_config_frauAppConfigBuilder_oslo);

if (!opts.appFile) {
console.log(chalk.red('Target appFile not specified.'));
process.exit(1);
Expand All @@ -41,6 +44,10 @@ if (opts.envVar && process.env[opts.envVar]) {
target = publisher.app(publisherOpts)
.getLocation() + opts.appFile;

if (oslo) {
opts.oslo = publisher.app(publisherOpts)
.getLocation() + oslo;
}
} else {

var localAppResolver = require('frau-local-appresolver');
Expand Down
4 changes: 4 additions & 0 deletions lib/appConfigBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ function build(opts, loader) {
loader: loader
};

if (opts.oslo) {
appConfig.oslo = opts.oslo;
}

return appConfig;
}

Expand Down

0 comments on commit e95fdac

Please sign in to comment.