console.log(`Built ${plugin.className}`)
}
-(async () => {
- try {
- const basename = path.basename(__filename)
- const timeLabel = `[${basename}] finished`
-
- console.log('Building individual plugins...')
- console.time(timeLabel)
-
- await Promise.all(Object.values(resolvedPlugins).map(plugin => build(plugin)))
-
- console.timeEnd(timeLabel)
- } catch (error) {
- console.error(error)
- process.exit(1)
- }
-})()
+const basename = path.basename(__filename)
+const timeLabel = `[${basename}] finished`
+
+console.log('Building individual plugins...')
+console.time(timeLabel)
+
+await Promise.all(Object.values(resolvedPlugins).map(plugin => build(plugin)))
+
+console.timeEnd(timeLabel)
process.exit(1)
}
-async function main(args) {
- let [oldVersion, newVersion] = args
+const args = process.argv.slice(2)
+let [oldVersion, newVersion] = args
- if (!oldVersion || !newVersion) {
- showUsage(args)
- }
-
- // Strip any leading `v` from arguments because
- // otherwise we will end up with duplicate `v`s
- [oldVersion, newVersion] = [oldVersion, newVersion].map(arg => {
- return arg.startsWith('v') ? arg.slice(1) : arg
- })
-
- if (oldVersion === newVersion) {
- showUsage(args)
- }
+if (!oldVersion || !newVersion) {
+ showUsage(args)
+}
- bumpNpmVersion(newVersion)
+// Strip any leading `v` from arguments because
+// otherwise we will end up with duplicate `v`s
+[oldVersion, newVersion] = [oldVersion, newVersion].map(arg => {
+ return arg.startsWith('v') ? arg.slice(1) : arg
+})
- try {
- await Promise.all(
- FILES.map(file => replaceRecursively(file, oldVersion, newVersion))
- )
- } catch (error) {
- console.error(error)
- process.exit(1)
- }
+if (oldVersion === newVersion) {
+ showUsage(args)
}
-main(process.argv.slice(2))
+bumpNpmVersion(newVersion)
+
+await Promise.all(
+ FILES.map(file => replaceRecursively(file, oldVersion, newVersion))
+)