Skip to content

Commit

Permalink
Upgrading fs-extra.
Browse files Browse the repository at this point in the history
  • Loading branch information
gbochenek committed Jun 28, 2017
1 parent 92b470a commit 9caa709
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
32 changes: 21 additions & 11 deletions app/utilscripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,30 +322,40 @@ function getThemeNlsModule(basePath, options) {
}

function addI18NFeatureActionsLabel(manifest) {
if (!fs.existsSync(path.join(manifest.location, 'nls'))) {
if (!fs.existsSync(path.join(manifest.location, "nls"))) {
return;
}
// get feature actions
var featureActions = manifest.featureActions;
featureActions.forEach(function(featureAction){
featureActions.forEach(function(featureAction) {
manifest["i18nLabels_featureAction_" + featureAction.name] = {};
//theme or widget label
var key = '_featureAction_' + featureAction.name;
var defaultStrings = requirejs(path.join(manifest.location, 'nls/strings.js'));
var key = "_featureAction_" + featureAction.name;
var defaultStrings = requirejs(
path.join(manifest.location, "nls/strings.js")
);
if (defaultStrings.root && defaultStrings.root[key]) {
manifest["i18nLabels_featureAction_" + featureAction.name].defaultLabel = defaultStrings.root[key];
manifest[
"i18nLabels_featureAction_" + featureAction.name
].defaultLabel = defaultStrings.root[key];
}
for (var p in defaultStrings) {
if (p === 'root' || !defaultStrings[p]) {
if (p === "root" || !defaultStrings[p]) {
continue;
}
if (!fs.existsSync(path.join(manifest.location, 'nls', p, 'strings.js'))) {
if (
!fs.existsSync(path.join(manifest.location, "nls", p, "strings.js"))
) {
continue;
}

var localeStrings = requirejs(path.join(manifest.location, 'nls', p, 'strings.js'));
var localeStrings = requirejs(
path.join(manifest.location, "nls", p, "strings.js")
);
if (localeStrings[key]) {
manifest["i18nLabels_featureAction_" + featureAction.name][p] = localeStrings[key];
manifest["i18nLabels_featureAction_" + featureAction.name][
p
] = localeStrings[key];
}
}
});
Expand Down Expand Up @@ -549,11 +559,11 @@ function dodelete(f, check) {
if (check) {
if (fs.existsSync(f)) {
console.log("delete", f);
fse.deleteSync(f);
fse.removeSync(f);
}
} else {
console.log("delete", f);
fse.deleteSync(f);
fse.removeSync(f);
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"url": "https://github.com/gbochenek/esri-wab-build"
},
"dependencies": {
"fs-extra": "^0.11.0",
"fs-extra": "^3.0.1",
"husky": "^0.13.3",
"lint-staged": "^3.4.0",
"prettier": "^0.22.0",
Expand Down

0 comments on commit 9caa709

Please sign in to comment.