Skip to content

Commit

Permalink
Script cleanup (#298)
Browse files Browse the repository at this point in the history
* Move custom-loader script to root and rename

* Convert jbash script over to jsh
  • Loading branch information
bradymholt authored Oct 23, 2023
1 parent 5fc13de commit 75e6c13
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions scripts/convert-ced-locale.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
#!/usr/bin/env npx jbash
#!/usr/bin/env npx jsh

/* Converts a Cron Expression Descriptor (https://github.com/bradymholt/cron-expression-descriptor/blob/master/scripts/release.js)
locale to a cronstrue locale.
Example usage:
convert-ced-locale.js /Users/jdoe/cron-expression-descriptor/lib/Resources.ja.resx
*/
usage(`\
Usage:
${0} convert-ced-locale.js path_to_ced_locale_file
Converts a Cron Expression Descriptor (https://github.com/bradymholt/cron-expression-descriptor/blob/master/scripts/release.js)
locale to a cronstrue locale
`)

const pathToSourceLocaleFile = args.assert(1);
const xmlHelper = require("pixl-xml");
const xmlContent = cat($1);
const xmlContent = readFile(pathToSourceLocaleFile);
const parsed = xmlHelper.parse(xmlContent);
const locale = $1
const locale = pathToSourceLocaleFile
.split(".")
.slice(-2)
.shift();
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ cronstrue.locales["${localeCode}"] = new ${localeCode}();
},
resolveLoader: {
alias: {
"custom-loader": path.resolve(__dirname, "scripts/custom-loader"),
"custom-loader": path.resolve(__dirname, "./webpack-custom-loader"),
},
},
},
Expand Down

0 comments on commit 75e6c13

Please sign in to comment.