Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
(scripts): fix comiconfig loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Crete committed Jun 22, 2018
1 parent fd76588 commit 27c86fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test": "noderize-scripts test",
"lint": "noderize-scripts lint",
"clean": "noderize-scripts clean",
"prepack": "npm run clean && npm run build -- --env production"
"prepare": "npm run clean && npm run build -- --env production"
},
"dependencies": {
"@noderize/runtime": "^0.7.2",
Expand Down
3 changes: 1 addition & 2 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"format": "npm run scripts -- format",
"clean": "npm run scripts -- clean",
"lint": "npm run scripts -- lint",
"bootstrap": " noderize-scripts build",
"prepack": "npm run bootstrap && npm run build && mv dist/ dist-temp/ && node dist-temp build -- --env production && chmod +x -R dist && rm -r dist-temp"
"prepare": "noderize-scripts build && npm run build && mv dist/ dist-temp/ && node dist-temp build -- --env production && chmod +x -R dist && rm -r dist-temp"
},
"dependencies": {
"@babel/core": "^7.0.0-beta.46",
Expand Down
6 changes: 3 additions & 3 deletions packages/scripts/src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ export function getOptions(rawArgs, env = null) {
let options = {};
try {
// Load from "noderize" key in package.json, .noderizerc, or noderize.config.js
const results = cosmiconfig("noderize", { sync: true }).load();
const results = cosmiconfig("noderize").searchSync();

if (results) {
const configOptions = results.config;
const configOptions = results.config || {};
Object.keys(configOptions).forEach(configOptionKey => {
if (types[configOptionKey] !== undefined) {
const type = types[configOptionKey];
Expand Down Expand Up @@ -431,7 +431,7 @@ export function getOptions(rawArgs, env = null) {
if (envConfig === undefined) {
log.warn(`Could not find '${options.currentEnv}' environment.`);
} else {
Object.keys(envConfig).forEach(envKey => {
Object.keys(envConfig || {}).forEach(envKey => {
options[envKey] = envConfig[envKey];
});
}
Expand Down

0 comments on commit 27c86fb

Please sign in to comment.