@mimik/local 5.0.1 → 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -0
- package/lib/helpers.js +6 -6
- package/package.json +1 -1
- package/scripts.json +4 -1
package/index.js
CHANGED
package/lib/helpers.js
CHANGED
|
@@ -175,7 +175,7 @@ const retrieve = (regType, filename, options) => {
|
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
try {
|
|
178
|
-
result = read(filename, regType);
|
|
178
|
+
result = parse(read(filename, regType), filename, regType);
|
|
179
179
|
console.log('- using ' + filename.info);
|
|
180
180
|
return result;
|
|
181
181
|
}
|
|
@@ -183,7 +183,7 @@ const retrieve = (regType, filename, options) => {
|
|
|
183
183
|
if (!options) exitError(regType, { statusCode: 404, message: `no options (${errFilename})` }, filename);
|
|
184
184
|
if (options.altFilename) {
|
|
185
185
|
try {
|
|
186
|
-
result = read(options.altFilename, regType);
|
|
186
|
+
result = parse(read(options.altFilename, regType), options.altFilename, regType);
|
|
187
187
|
console.log('- using ' + options.altFilename.info);
|
|
188
188
|
return result;
|
|
189
189
|
}
|
|
@@ -191,17 +191,17 @@ const retrieve = (regType, filename, options) => {
|
|
|
191
191
|
if (!options.sourceFileName) {
|
|
192
192
|
if (!options.default) exitError(regType, { statusCode: 404, message: `no files or default (${errAltFilename})` }, filename);
|
|
193
193
|
console.log('- using ' + 'default'.warn + ' for ' + filename.info);
|
|
194
|
-
return write(filename, options.default, regType);
|
|
194
|
+
return write(filename, options.default, regType, true);
|
|
195
195
|
}
|
|
196
|
-
return write(filename, readSourceDefault(options.sourceFilename, options.sourceFilenameSupp, options.default, filename), regType);
|
|
196
|
+
return write(filename, readSourceDefault(options.sourceFilename, options.sourceFilenameSupp, options.default, filename), regType, true);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
if (!options.sourceFilename) {
|
|
200
200
|
if (!options.default) exitError(regType, { statusCode: 404, message: `no files or default (${errFilename.message})` }, filename);
|
|
201
201
|
console.log('- using ' + 'default'.warn + ' for ' + filename.info);
|
|
202
|
-
return write(filename, options.default, regType);
|
|
202
|
+
return write(filename, options.default, regType, true);
|
|
203
203
|
}
|
|
204
|
-
return write(filename, readSourceDefault(options.sourceFilename, options.sourceFilenameSupp, options.default, filename), regType);
|
|
204
|
+
return write(filename, readSourceDefault(options.sourceFilename, options.sourceFilenameSupp, options.default, filename), regType, true);
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
207
|
|
package/package.json
CHANGED
package/scripts.json
CHANGED
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
"prestart": "node ./local/setup.js",
|
|
9
9
|
"start": "sh server-start.sh",
|
|
10
10
|
"pre-push": "npm run docs && npm run lint && npm run test",
|
|
11
|
+
"pre-push-install": "npx husky add .husky/pre-push \"npm run pre-push\"",
|
|
11
12
|
"pre-commit": "npm run docs && npm run lint",
|
|
12
|
-
"
|
|
13
|
+
"pre-commit-install": "npx husky add .husky/pre-commit \"npm run pre-commit\"",
|
|
14
|
+
"commit-msg-install": "npx husky add .husky/commit-msg \"node ./local/commitMsgCheck $1\"",
|
|
15
|
+
"prepare": "husky install && npm run pre-push-install && npm run pre-commit-install && npm run commit-msg-install"
|
|
13
16
|
},
|
|
14
17
|
"husky": {
|
|
15
18
|
"hooks": {
|