@gluhar/cli 3.0.2 → 3.1.5

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.
Files changed (403) hide show
  1. package/package.json +46 -46
  2. package/src/GlobalOptions.d.ts +8 -0
  3. package/src/GlobalOptions.d.ts.map +1 -0
  4. package/src/GlobalOptions.js +2 -0
  5. package/src/commands/blank/BlankOptions.d.ts +4 -0
  6. package/src/commands/blank/BlankOptions.d.ts.map +1 -0
  7. package/src/commands/blank/BlankOptions.js +2 -0
  8. package/src/commands/blank/blank.d.ts +3 -0
  9. package/src/commands/blank/blank.d.ts.map +1 -0
  10. package/src/commands/blank/blank.js +8 -0
  11. package/src/commands/blank/index.d.ts +4 -0
  12. package/src/commands/blank/index.d.ts.map +1 -0
  13. package/src/commands/blank/index.js +9 -0
  14. package/src/commands/blank/log.d.ts +2 -0
  15. package/src/commands/blank/log.d.ts.map +1 -0
  16. package/src/commands/blank/log.js +5 -0
  17. package/src/commands/build/BuildOptions.d.ts +4 -0
  18. package/src/commands/build/BuildOptions.d.ts.map +1 -0
  19. package/src/commands/build/BuildOptions.js +2 -0
  20. package/src/commands/build/build.d.ts +3 -0
  21. package/src/commands/build/build.d.ts.map +1 -0
  22. package/src/commands/build/build.js +22 -0
  23. package/src/commands/build/index.d.ts +4 -0
  24. package/src/commands/build/index.d.ts.map +1 -0
  25. package/src/commands/build/index.js +9 -0
  26. package/src/commands/build/log.d.ts +2 -0
  27. package/src/commands/build/log.d.ts.map +1 -0
  28. package/src/commands/build/log.js +5 -0
  29. package/src/commands/deinstall/DeinstallOptions.d.ts +4 -0
  30. package/src/commands/deinstall/DeinstallOptions.d.ts.map +1 -0
  31. package/src/commands/deinstall/DeinstallOptions.js +2 -0
  32. package/src/commands/deinstall/deinstall.d.ts +3 -0
  33. package/src/commands/deinstall/deinstall.d.ts.map +1 -0
  34. package/src/commands/deinstall/deinstall.js +21 -0
  35. package/src/commands/deinstall/index.d.ts +4 -0
  36. package/src/commands/deinstall/index.d.ts.map +1 -0
  37. package/src/commands/deinstall/index.js +9 -0
  38. package/src/commands/deinstall/log.d.ts +2 -0
  39. package/src/commands/deinstall/log.d.ts.map +1 -0
  40. package/src/commands/deinstall/log.js +5 -0
  41. package/src/commands/deploy/DeployOptions.d.ts +7 -0
  42. package/src/commands/deploy/DeployOptions.d.ts.map +1 -0
  43. package/src/commands/deploy/DeployOptions.js +2 -0
  44. package/src/commands/deploy/deploy.d.ts +3 -0
  45. package/src/commands/deploy/deploy.d.ts.map +1 -0
  46. package/src/commands/deploy/deploy.js +33 -0
  47. package/src/commands/deploy/deployIos.d.ts +2 -0
  48. package/src/commands/deploy/deployIos.d.ts.map +1 -0
  49. package/src/commands/deploy/deployIos.js +44 -0
  50. package/src/commands/deploy/index.d.ts +4 -0
  51. package/src/commands/deploy/index.d.ts.map +1 -0
  52. package/src/commands/deploy/index.js +12 -0
  53. package/src/commands/deploy/log.d.ts +2 -0
  54. package/src/commands/deploy/log.d.ts.map +1 -0
  55. package/src/commands/deploy/log.js +5 -0
  56. package/src/commands/deploy/setSsr.d.ts +2 -0
  57. package/src/commands/deploy/setSsr.d.ts.map +1 -0
  58. package/src/commands/deploy/setSsr.js +25 -0
  59. package/src/commands/dev/DevOptions.d.ts +5 -0
  60. package/src/commands/dev/DevOptions.d.ts.map +1 -0
  61. package/src/commands/dev/DevOptions.js +2 -0
  62. package/src/commands/dev/dev.d.ts +3 -0
  63. package/src/commands/dev/dev.d.ts.map +1 -0
  64. package/src/commands/dev/dev.js +16 -0
  65. package/src/commands/dev/devIos.d.ts +3 -0
  66. package/src/commands/dev/devIos.d.ts.map +1 -0
  67. package/src/commands/dev/devIos.js +26 -0
  68. package/src/commands/dev/index.d.ts +4 -0
  69. package/src/commands/dev/index.d.ts.map +1 -0
  70. package/src/commands/dev/index.js +10 -0
  71. package/src/commands/dev/log.d.ts +2 -0
  72. package/src/commands/dev/log.d.ts.map +1 -0
  73. package/src/commands/dev/log.js +5 -0
  74. package/src/commands/generate/GenerateOptions.d.ts +9 -0
  75. package/src/commands/generate/GenerateOptions.d.ts.map +1 -0
  76. package/src/commands/generate/GenerateOptions.js +4 -0
  77. package/src/commands/generate/generate.d.ts +3 -0
  78. package/src/commands/generate/generate.d.ts.map +1 -0
  79. package/src/commands/generate/generate.js +22 -0
  80. package/src/commands/generate/generateCommand.d.ts +2 -0
  81. package/src/commands/generate/generateCommand.d.ts.map +1 -0
  82. package/src/commands/generate/generateCommand.js +36 -0
  83. package/src/commands/generate/generateProject.d.ts +3 -0
  84. package/src/commands/generate/generateProject.d.ts.map +1 -0
  85. package/src/commands/generate/generateProject.js +85 -0
  86. package/src/commands/generate/index.d.ts +4 -0
  87. package/src/commands/generate/index.d.ts.map +1 -0
  88. package/src/commands/generate/index.js +14 -0
  89. package/src/commands/generate/log.d.ts +2 -0
  90. package/src/commands/generate/log.d.ts.map +1 -0
  91. package/src/commands/generate/log.js +5 -0
  92. package/src/commands/index.d.ts +3 -0
  93. package/src/commands/index.d.ts.map +1 -0
  94. package/src/commands/index.js +25 -0
  95. package/src/commands/reinstall/ReinstallOptions.d.ts +4 -0
  96. package/src/commands/reinstall/ReinstallOptions.d.ts.map +1 -0
  97. package/src/commands/reinstall/ReinstallOptions.js +2 -0
  98. package/src/commands/reinstall/index.d.ts +4 -0
  99. package/src/commands/reinstall/index.d.ts.map +1 -0
  100. package/src/commands/reinstall/index.js +9 -0
  101. package/src/commands/reinstall/log.d.ts +2 -0
  102. package/src/commands/reinstall/log.d.ts.map +1 -0
  103. package/src/commands/reinstall/log.js +5 -0
  104. package/src/commands/reinstall/reinstall.d.ts +3 -0
  105. package/src/commands/reinstall/reinstall.d.ts.map +1 -0
  106. package/src/commands/reinstall/reinstall.js +14 -0
  107. package/src/commands/release/ReleaseOptions.d.ts +9 -0
  108. package/src/commands/release/ReleaseOptions.d.ts.map +1 -0
  109. package/src/commands/release/ReleaseOptions.js +2 -0
  110. package/src/commands/release/index.d.ts +4 -0
  111. package/src/commands/release/index.d.ts.map +1 -0
  112. package/src/commands/release/index.js +22 -0
  113. package/src/commands/release/log.d.ts +2 -0
  114. package/src/commands/release/log.d.ts.map +1 -0
  115. package/src/commands/release/log.js +5 -0
  116. package/src/commands/release/publish.d.ts +3 -0
  117. package/src/commands/release/publish.d.ts.map +1 -0
  118. package/src/commands/release/publish.js +18 -0
  119. package/src/commands/release/release.d.ts +3 -0
  120. package/src/commands/release/release.d.ts.map +1 -0
  121. package/src/commands/release/release.js +24 -0
  122. package/src/commands/release/tag.d.ts +23 -0
  123. package/src/commands/release/tag.d.ts.map +1 -0
  124. package/src/commands/release/tag.js +90 -0
  125. package/src/commands/upgrade/UpgradeOptions.d.ts +4 -0
  126. package/src/commands/upgrade/UpgradeOptions.d.ts.map +1 -0
  127. package/src/commands/upgrade/UpgradeOptions.js +2 -0
  128. package/src/commands/upgrade/index.d.ts +4 -0
  129. package/src/commands/upgrade/index.d.ts.map +1 -0
  130. package/src/commands/upgrade/index.js +9 -0
  131. package/src/commands/upgrade/log.d.ts +2 -0
  132. package/src/commands/upgrade/log.d.ts.map +1 -0
  133. package/src/commands/upgrade/log.js +5 -0
  134. package/src/commands/upgrade/upgrade.d.ts +3 -0
  135. package/src/commands/upgrade/upgrade.d.ts.map +1 -0
  136. package/src/commands/upgrade/upgrade.js +11 -0
  137. package/src/commands/version/VersionOptions.d.ts +8 -0
  138. package/src/commands/version/VersionOptions.d.ts.map +1 -0
  139. package/src/commands/version/VersionOptions.js +2 -0
  140. package/src/commands/version/getPreid.d.ts +2 -0
  141. package/src/commands/version/getPreid.d.ts.map +1 -0
  142. package/src/commands/version/getPreid.js +10 -0
  143. package/src/commands/version/index.d.ts +4 -0
  144. package/src/commands/version/index.d.ts.map +1 -0
  145. package/src/commands/version/index.js +12 -0
  146. package/src/commands/version/log.d.ts +2 -0
  147. package/src/commands/version/log.d.ts.map +1 -0
  148. package/src/commands/version/log.js +5 -0
  149. package/src/commands/version/pimpChangelogs.d.ts +2 -0
  150. package/src/commands/version/pimpChangelogs.d.ts.map +1 -0
  151. package/src/commands/version/pimpChangelogs.js +37 -0
  152. package/src/commands/version/version.d.ts +3 -0
  153. package/src/commands/version/version.d.ts.map +1 -0
  154. package/src/commands/version/version.js +33 -0
  155. package/src/constants.d.ts +4 -0
  156. package/src/constants.d.ts.map +1 -0
  157. package/src/constants.js +7 -0
  158. package/src/index.d.ts +3 -0
  159. package/src/index.d.ts.map +1 -0
  160. package/src/index.js +24 -0
  161. package/src/preAction.d.ts +3 -0
  162. package/src/preAction.d.ts.map +1 -0
  163. package/src/preAction.js +81 -0
  164. package/src/scripts/cmd/cd.d.ts +2 -0
  165. package/src/scripts/cmd/cd.d.ts.map +1 -0
  166. package/src/scripts/cmd/cd.js +15 -0
  167. package/src/scripts/cmd/{executeBash.ts → executeBash.d.ts} +10 -20
  168. package/src/scripts/cmd/executeBash.d.ts.map +1 -0
  169. package/src/scripts/cmd/executeBash.js +21 -0
  170. package/src/scripts/cmd/executeCmd.d.ts +9 -0
  171. package/src/scripts/cmd/executeCmd.d.ts.map +1 -0
  172. package/src/scripts/cmd/executeCmd.js +23 -0
  173. package/src/scripts/cmd/{getBashOutput.ts → getBashOutput.d.ts} +10 -23
  174. package/src/scripts/cmd/getBashOutput.d.ts.map +1 -0
  175. package/src/scripts/cmd/getBashOutput.js +19 -0
  176. package/src/scripts/cmd/getCmdOutput.d.ts +10 -0
  177. package/src/scripts/cmd/getCmdOutput.d.ts.map +1 -0
  178. package/src/scripts/cmd/getCmdOutput.js +26 -0
  179. package/src/scripts/cmd/{index.ts → index.d.ts} +8 -10
  180. package/src/scripts/cmd/index.d.ts.map +1 -0
  181. package/src/scripts/cmd/index.js +25 -0
  182. package/src/scripts/cmd/log.d.ts +2 -0
  183. package/src/scripts/cmd/log.d.ts.map +1 -0
  184. package/src/scripts/cmd/log.js +5 -0
  185. package/src/scripts/cmd/parseArgs.d.ts +3 -0
  186. package/src/scripts/cmd/parseArgs.d.ts.map +1 -0
  187. package/src/scripts/cmd/parseArgs.js +41 -0
  188. package/src/scripts/cmd/parseBashArgs.d.ts +3 -0
  189. package/src/scripts/cmd/parseBashArgs.d.ts.map +1 -0
  190. package/src/scripts/cmd/parseBashArgs.js +16 -0
  191. package/src/scripts/cmd/types.d.ts +12 -0
  192. package/src/scripts/cmd/types.d.ts.map +1 -0
  193. package/src/scripts/cmd/types.js +2 -0
  194. package/src/scripts/filesystem/copyDir.d.ts +9 -0
  195. package/src/scripts/filesystem/copyDir.d.ts.map +1 -0
  196. package/src/scripts/filesystem/copyDir.js +26 -0
  197. package/src/scripts/filesystem/copyFiles.d.ts +11 -0
  198. package/src/scripts/filesystem/copyFiles.d.ts.map +1 -0
  199. package/src/scripts/filesystem/copyFiles.js +59 -0
  200. package/src/scripts/filesystem/findFile.d.ts +2 -0
  201. package/src/scripts/filesystem/findFile.d.ts.map +1 -0
  202. package/src/scripts/filesystem/findFile.js +24 -0
  203. package/src/scripts/filesystem/index.d.ts +10 -0
  204. package/src/scripts/filesystem/index.d.ts.map +1 -0
  205. package/src/scripts/filesystem/index.js +17 -0
  206. package/src/scripts/filesystem/loadJsonFile.d.ts +2 -0
  207. package/src/scripts/filesystem/loadJsonFile.d.ts.map +1 -0
  208. package/src/scripts/filesystem/loadJsonFile.js +18 -0
  209. package/src/scripts/filesystem/log.d.ts +2 -0
  210. package/src/scripts/filesystem/log.d.ts.map +1 -0
  211. package/src/scripts/filesystem/log.js +5 -0
  212. package/src/scripts/filesystem/readDirRecursive.d.ts +2 -0
  213. package/src/scripts/filesystem/readDirRecursive.d.ts.map +1 -0
  214. package/src/scripts/filesystem/readDirRecursive.js +16 -0
  215. package/src/scripts/git/branch/branchDelete.d.ts +6 -0
  216. package/src/scripts/git/branch/branchDelete.d.ts.map +1 -0
  217. package/src/scripts/git/branch/branchDelete.js +24 -0
  218. package/src/scripts/git/branch/branchExists.d.ts +5 -0
  219. package/src/scripts/git/branch/branchExists.d.ts.map +1 -0
  220. package/src/scripts/git/branch/branchExists.js +15 -0
  221. package/src/scripts/git/branch/checkout.d.ts +5 -0
  222. package/src/scripts/git/branch/checkout.d.ts.map +1 -0
  223. package/src/scripts/git/branch/checkout.js +15 -0
  224. package/src/scripts/git/branch/getCurrentBranch.d.ts +11 -0
  225. package/src/scripts/git/branch/getCurrentBranch.d.ts.map +1 -0
  226. package/src/scripts/git/branch/getCurrentBranch.js +28 -0
  227. package/src/scripts/git/clone.d.ts +10 -0
  228. package/src/scripts/git/clone.d.ts.map +1 -0
  229. package/src/scripts/git/clone.js +14 -0
  230. package/src/scripts/git/commit.sh +0 -0
  231. package/src/scripts/git/getRepo.d.ts +2 -0
  232. package/src/scripts/git/getRepo.d.ts.map +1 -0
  233. package/src/scripts/git/getRepo.js +13 -0
  234. package/src/scripts/git/index.d.ts +29 -0
  235. package/src/scripts/git/index.d.ts.map +1 -0
  236. package/src/scripts/git/index.js +40 -0
  237. package/src/scripts/git/log.d.ts +2 -0
  238. package/src/scripts/git/log.d.ts.map +1 -0
  239. package/src/scripts/git/log.js +5 -0
  240. package/src/scripts/git/openPr.d.ts +2 -0
  241. package/src/scripts/git/openPr.d.ts.map +1 -0
  242. package/src/scripts/git/openPr.js +20 -0
  243. package/src/scripts/git/remoteStatus.d.ts +3 -0
  244. package/src/scripts/git/remoteStatus.d.ts.map +1 -0
  245. package/src/scripts/git/remoteStatus.js +22 -0
  246. package/src/scripts/git/tag/createTag.d.ts +18 -0
  247. package/src/scripts/git/tag/createTag.d.ts.map +1 -0
  248. package/src/scripts/git/tag/createTag.js +18 -0
  249. package/src/scripts/git/tag/deleteTag.d.ts +2 -0
  250. package/src/scripts/git/tag/deleteTag.d.ts.map +1 -0
  251. package/src/scripts/git/tag/deleteTag.js +13 -0
  252. package/src/scripts/git/tag/getTags.d.ts +2 -0
  253. package/src/scripts/git/tag/getTags.d.ts.map +1 -0
  254. package/src/scripts/git/tag/getTags.js +8 -0
  255. package/src/scripts/git/tag/pushAllTags.d.ts +2 -0
  256. package/src/scripts/git/tag/pushAllTags.d.ts.map +1 -0
  257. package/src/scripts/git/tag/pushAllTags.js +8 -0
  258. package/src/scripts/git/tag/renameTag.d.ts +2 -0
  259. package/src/scripts/git/tag/renameTag.d.ts.map +1 -0
  260. package/src/scripts/git/tag/renameTag.js +14 -0
  261. package/src/scripts/lerna/changed.d.ts +3 -0
  262. package/src/scripts/lerna/changed.d.ts.map +1 -0
  263. package/src/scripts/lerna/changed.js +13 -0
  264. package/src/scripts/lerna/constants.d.ts +5 -0
  265. package/src/scripts/lerna/constants.d.ts.map +1 -0
  266. package/src/scripts/lerna/constants.js +7 -0
  267. package/src/scripts/lerna/filterByDependency.d.ts +7 -0
  268. package/src/scripts/lerna/filterByDependency.d.ts.map +1 -0
  269. package/src/scripts/lerna/filterByDependency.js +18 -0
  270. package/src/scripts/lerna/getConfig.d.ts +3 -0
  271. package/src/scripts/lerna/getConfig.d.ts.map +1 -0
  272. package/src/scripts/lerna/getConfig.js +13 -0
  273. package/src/scripts/lerna/getDependencies.d.ts +9 -0
  274. package/src/scripts/lerna/getDependencies.d.ts.map +1 -0
  275. package/src/scripts/lerna/getDependencies.js +23 -0
  276. package/src/scripts/lerna/getDetails.d.ts +3 -0
  277. package/src/scripts/lerna/getDetails.d.ts.map +1 -0
  278. package/src/scripts/lerna/getDetails.js +38 -0
  279. package/src/scripts/lerna/index.d.ts +14 -0
  280. package/src/scripts/lerna/index.d.ts.map +1 -0
  281. package/src/scripts/lerna/index.js +19 -0
  282. package/src/scripts/lerna/log.d.ts +2 -0
  283. package/src/scripts/lerna/log.d.ts.map +1 -0
  284. package/src/scripts/lerna/log.js +5 -0
  285. package/src/scripts/lerna/publish.sh +0 -0
  286. package/src/scripts/lerna/types.d.ts +62 -0
  287. package/src/scripts/lerna/types.d.ts.map +1 -0
  288. package/src/scripts/lerna/types.js +2 -0
  289. package/src/scripts/lerna/version.sh +1 -1
  290. package/src/utils/chalk.d.ts +4 -0
  291. package/src/utils/chalk.d.ts.map +1 -0
  292. package/src/utils/chalk.js +9 -0
  293. package/src/utils/common.d.ts +8 -0
  294. package/src/utils/common.d.ts.map +1 -0
  295. package/src/utils/common.js +21 -0
  296. package/src/utils/{index.ts → index.d.ts} +4 -3
  297. package/src/utils/index.d.ts.map +1 -0
  298. package/src/utils/index.js +19 -0
  299. package/src/utils/inquirer.d.ts +5 -0
  300. package/src/utils/inquirer.d.ts.map +1 -0
  301. package/src/utils/inquirer.js +21 -0
  302. package/src/utils/logger.d.ts +9 -0
  303. package/src/utils/logger.d.ts.map +1 -0
  304. package/src/utils/logger.js +36 -0
  305. package/CHANGELOG.md +0 -628
  306. package/README.md +0 -11
  307. package/src/GlobalOptions.ts +0 -8
  308. package/src/commands/blank/BlankOptions.ts +0 -3
  309. package/src/commands/blank/blank.ts +0 -6
  310. package/src/commands/blank/index.ts +0 -8
  311. package/src/commands/blank/log.ts +0 -3
  312. package/src/commands/build/BuildOptions.ts +0 -3
  313. package/src/commands/build/build.ts +0 -24
  314. package/src/commands/build/index.ts +0 -8
  315. package/src/commands/build/log.ts +0 -3
  316. package/src/commands/deinstall/DeinstallOptions.ts +0 -3
  317. package/src/commands/deinstall/deinstall.ts +0 -19
  318. package/src/commands/deinstall/index.ts +0 -11
  319. package/src/commands/deinstall/log.ts +0 -3
  320. package/src/commands/deploy/DeployOptions.ts +0 -6
  321. package/src/commands/deploy/deploy.ts +0 -39
  322. package/src/commands/deploy/deployIos.ts +0 -48
  323. package/src/commands/deploy/index.ts +0 -20
  324. package/src/commands/deploy/log.ts +0 -3
  325. package/src/commands/deploy/setSsr.ts +0 -25
  326. package/src/commands/dev/DevOptions.ts +0 -4
  327. package/src/commands/dev/dev.ts +0 -15
  328. package/src/commands/dev/devIos.ts +0 -23
  329. package/src/commands/dev/index.ts +0 -12
  330. package/src/commands/dev/log.ts +0 -3
  331. package/src/commands/generate/GenerateOptions.ts +0 -9
  332. package/src/commands/generate/generate.ts +0 -29
  333. package/src/commands/generate/generateCommand.ts +0 -46
  334. package/src/commands/generate/generateProject.ts +0 -115
  335. package/src/commands/generate/index.ts +0 -19
  336. package/src/commands/generate/log.ts +0 -3
  337. package/src/commands/index.ts +0 -21
  338. package/src/commands/reinstall/ReinstallOptions.ts +0 -3
  339. package/src/commands/reinstall/index.ts +0 -11
  340. package/src/commands/reinstall/log.ts +0 -3
  341. package/src/commands/reinstall/reinstall.ts +0 -13
  342. package/src/commands/release/ReleaseOptions.ts +0 -8
  343. package/src/commands/release/index.ts +0 -40
  344. package/src/commands/release/log.ts +0 -3
  345. package/src/commands/release/publish.ts +0 -18
  346. package/src/commands/release/release.ts +0 -24
  347. package/src/commands/release/tag.ts +0 -119
  348. package/src/commands/upgrade/UpgradeOptions.ts +0 -3
  349. package/src/commands/upgrade/index.ts +0 -10
  350. package/src/commands/upgrade/log.ts +0 -3
  351. package/src/commands/upgrade/upgrade.ts +0 -10
  352. package/src/commands/version/VersionOptions.ts +0 -7
  353. package/src/commands/version/getPreid.ts +0 -7
  354. package/src/commands/version/index.ts +0 -18
  355. package/src/commands/version/log.ts +0 -3
  356. package/src/commands/version/pimpChangelogs.ts +0 -43
  357. package/src/commands/version/version.ts +0 -33
  358. package/src/constants.ts +0 -5
  359. package/src/index.ts +0 -24
  360. package/src/preAction.ts +0 -93
  361. package/src/scripts/cmd/cd.ts +0 -9
  362. package/src/scripts/cmd/executeCmd.ts +0 -23
  363. package/src/scripts/cmd/getCmdOutput.ts +0 -26
  364. package/src/scripts/cmd/log.ts +0 -3
  365. package/src/scripts/cmd/parseArgs.ts +0 -44
  366. package/src/scripts/cmd/parseBashArgs.ts +0 -21
  367. package/src/scripts/cmd/types.ts +0 -13
  368. package/src/scripts/filesystem/copyDir.ts +0 -29
  369. package/src/scripts/filesystem/copyFiles.ts +0 -75
  370. package/src/scripts/filesystem/findFile.ts +0 -29
  371. package/src/scripts/filesystem/index.ts +0 -15
  372. package/src/scripts/filesystem/loadJsonFile.ts +0 -17
  373. package/src/scripts/filesystem/log.ts +0 -3
  374. package/src/scripts/filesystem/readDirRecursive.ts +0 -21
  375. package/src/scripts/git/branch/branchDelete.ts +0 -32
  376. package/src/scripts/git/branch/branchExists.ts +0 -14
  377. package/src/scripts/git/branch/checkout.ts +0 -19
  378. package/src/scripts/git/branch/getCurrentBranch.ts +0 -37
  379. package/src/scripts/git/clone.ts +0 -20
  380. package/src/scripts/git/getRepo.ts +0 -11
  381. package/src/scripts/git/index.ts +0 -44
  382. package/src/scripts/git/log.ts +0 -3
  383. package/src/scripts/git/openPr.ts +0 -21
  384. package/src/scripts/git/remoteStatus.ts +0 -28
  385. package/src/scripts/git/tag/createTag.ts +0 -28
  386. package/src/scripts/git/tag/deleteTag.ts +0 -11
  387. package/src/scripts/git/tag/getTags.ts +0 -6
  388. package/src/scripts/git/tag/pushAllTags.ts +0 -6
  389. package/src/scripts/git/tag/renameTag.ts +0 -12
  390. package/src/scripts/lerna/changed.ts +0 -11
  391. package/src/scripts/lerna/constants.ts +0 -6
  392. package/src/scripts/lerna/filterByDependency.ts +0 -21
  393. package/src/scripts/lerna/getConfig.ts +0 -12
  394. package/src/scripts/lerna/getDependencies.ts +0 -25
  395. package/src/scripts/lerna/getDetails.ts +0 -44
  396. package/src/scripts/lerna/index.ts +0 -18
  397. package/src/scripts/lerna/log.ts +0 -3
  398. package/src/scripts/lerna/types.ts +0 -64
  399. package/src/utils/chalk.ts +0 -4
  400. package/src/utils/common.ts +0 -16
  401. package/src/utils/inquirer.ts +0 -20
  402. package/src/utils/logger.ts +0 -51
  403. package/tsconfig.json +0 -28
@@ -1,24 +0,0 @@
1
- import { version } from "../version/version";
2
- import type { ReleaseOptions } from "./ReleaseOptions";
3
- import { log } from "./log";
4
- import { publish } from "./publish";
5
- import { tag } from "./tag";
6
-
7
- export const release = async (options: ReleaseOptions) => {
8
- log.info("Initiating release...");
9
- const { pre, dev, yes } = options;
10
- if (yes) log.info("and saying yes to all prompts.");
11
-
12
- if (options.version)
13
- await version({
14
- pre,
15
- dev,
16
- yes,
17
- changelog: !dev,
18
- commit: "chore: Releasing gluhar packages.",
19
- });
20
-
21
- publish(options);
22
-
23
- await tag(options);
24
- };
@@ -1,119 +0,0 @@
1
- import { lerna } from "src/scripts/lerna";
2
- import { INDEPENDENT_VERSION } from "src/scripts/lerna/constants";
3
- import { git } from "src/scripts/git";
4
- import { confirmQuestion } from "src/utils";
5
- import type { ReleaseOptions } from "./ReleaseOptions";
6
- import { log } from "./log";
7
-
8
- export const pattern = {
9
- /** e.g. `@gluhar/cli` */
10
- fullPackageName: "%f",
11
- /** e.g. `cli` */
12
- shortPackageName: "%s",
13
- /** e.g. `1.2.3` */
14
- version: "%v",
15
- default: {
16
- /** e.g. `cli/v1.2.3` */
17
- independent: "%f@%v",
18
- /** e.g. `v1.2.3` */
19
- fixed: "v%v",
20
- },
21
- };
22
-
23
- const getGitTagPattern = (
24
- gitTag: ReleaseOptions["gitTag"],
25
- isIndependent: boolean
26
- ) => {
27
- if (typeof gitTag === "string") {
28
- return gitTag;
29
- }
30
-
31
- if (!gitTag) {
32
- return null;
33
- }
34
-
35
- return isIndependent ? pattern.default.independent : pattern.default.fixed;
36
- };
37
-
38
- export interface PackageInfo {
39
- /** Required for independent versioning. */
40
- name?: string;
41
- version: string;
42
- }
43
-
44
- export const parsePattern = (tagPattern: string, pkg: PackageInfo): string => {
45
- const { name: fullName, version } = pkg;
46
- const placeholders: { pattern: string; value: string }[] = [
47
- {
48
- pattern: pattern.version,
49
- value: version,
50
- },
51
- ];
52
-
53
- if (fullName) {
54
- const shortName = fullName.substring(fullName.indexOf("/") + 1);
55
- placeholders.push({
56
- pattern: pattern.fullPackageName,
57
- value: fullName,
58
- });
59
- placeholders.push({
60
- pattern: pattern.shortPackageName,
61
- value: shortName,
62
- });
63
- }
64
-
65
- return placeholders.reduce(
66
- (t, ph) => t.replaceAll(ph.pattern, ph.value),
67
- tagPattern
68
- );
69
- };
70
-
71
- export const tag = async (options: ReleaseOptions) => {
72
- const { gitTag, yes } = options;
73
- if (!gitTag) {
74
- return;
75
- }
76
-
77
- const lernaConfig = lerna.getConfig();
78
- const isIndependent =
79
- !!lernaConfig && lernaConfig.version === INDEPENDENT_VERSION;
80
-
81
- const tagPattern = getGitTagPattern(gitTag, isIndependent);
82
- if (!tagPattern) {
83
- return;
84
- }
85
-
86
- const tags = new Set<string>();
87
-
88
- if (
89
- !lernaConfig ||
90
- isIndependent ||
91
- tagPattern.includes(pattern.fullPackageName) ||
92
- tagPattern.includes(pattern.shortPackageName)
93
- ) {
94
- lerna
95
- .changed()
96
- .filter((pkg) => !pkg.private)
97
- .map((pkg) => parsePattern(tagPattern, pkg))
98
- .forEach((t) => tags.add(t));
99
- } else {
100
- const t = parsePattern(tagPattern, { version: lernaConfig.version });
101
- tags.add(t);
102
- }
103
-
104
- const tagList = [...tags].map((t) => `\n - ${t}`).join("");
105
- log.verbose("Tags to create:", tagList);
106
-
107
- const confirm = await confirmQuestion(
108
- `Create and push tag(s): ${tagList}. Confirm?`,
109
- yes
110
- );
111
-
112
- if (confirm) {
113
- tags.forEach((t) => {
114
- git.tag.create(t);
115
- });
116
-
117
- git.tag.pushAll();
118
- }
119
- };
@@ -1,3 +0,0 @@
1
- export interface UpgradeOptions {
2
- upgrade: boolean;
3
- }
@@ -1,10 +0,0 @@
1
- import { Command } from "commander";
2
- import { upgrade } from "./upgrade";
3
-
4
- export default new Command()
5
- .name("upgrade")
6
- .description(
7
- "Upgrade all gluhar dependencies in a project to their latest versions."
8
- )
9
- .option("-b, --upgrade", "A boolean option.")
10
- .action(upgrade);
@@ -1,3 +0,0 @@
1
- import { logger } from "src/utils";
2
-
3
- export const log = logger("upgrade");
@@ -1,10 +0,0 @@
1
- import { executeCmd } from "src/scripts/cmd";
2
- import { UpgradeOptions } from "./UpgradeOptions";
3
- import { log } from "./log";
4
-
5
- export const upgrade = (options: UpgradeOptions) => {
6
- log.info("Upgrading gluhar dependencies.");
7
-
8
- // Upgrade all gluhar dependencies in a project to their latest versions.
9
- executeCmd("npm update @gluhar/cli @gluhar/app");
10
- };
@@ -1,7 +0,0 @@
1
- export interface VersionOptions {
2
- pre: boolean | string;
3
- dev: boolean;
4
- changelog: boolean;
5
- commit: boolean | string;
6
- yes?: boolean;
7
- }
@@ -1,7 +0,0 @@
1
- export const getPreid = (pre: boolean | string) => {
2
- if (typeof pre === 'string') {
3
- return pre;
4
- }
5
-
6
- return pre ? 'beta' : undefined;
7
- };
@@ -1,18 +0,0 @@
1
- import { Command } from "commander";
2
- import { version } from "./version";
3
-
4
- export default new Command()
5
- .name("version")
6
- .description("Update package versions and generate change logs.")
7
- .option(
8
- "--pre [id]",
9
- "Prerelease identifier. Use this when creating a prerelease versioning.",
10
- false
11
- )
12
- .option(
13
- "-d, --dev",
14
- "Release a dev version. This is a shorthand for a prerelease with a 'dev' identifier."
15
- )
16
- .option("--no-changelog", "Disable generating changelogs.")
17
- .option("-c, --commit [msg]", "Commit changes in git.", false)
18
- .action(version);
@@ -1,3 +0,0 @@
1
- import { logger } from 'src/utils';
2
-
3
- export const log = logger('version');
@@ -1,43 +0,0 @@
1
- import { log } from "./log";
2
- import { glob } from "glob";
3
- import { join } from "path";
4
- import { readFileSync, writeFileSync } from "fs";
5
- import { capitalize } from "src/utils/common";
6
-
7
- export const pimpChangelogs = async () => {
8
- log.info("Pimping changelogs");
9
-
10
- const g = join("packages", "**", "CHANGELOG.md");
11
- const filePaths = await glob(g);
12
-
13
- const changelogs = filePaths.map((fp) => {
14
- const changelog = readFileSync(fp).toString();
15
-
16
- const lines = changelog.split("\n").map((line) => {
17
- if (line.substring(0, 2) === "* ") {
18
- if (line.substring(0, 4) === "* **")
19
- return `- ${line.substring(2).split("** ").map(capitalize).join("** ")}`;
20
-
21
- return `- ${capitalize(line.substring(2))}`;
22
- }
23
-
24
- if (line.includes("**Note:**"))
25
- return line.replace("**Note:**", "**📝 Note:**");
26
-
27
- if (line.substring(0, 4) === "### ")
28
- return line
29
- .replace("### Features", "### 🚀 Enhancements")
30
- .replace("### Bug Fixes", "### 🩹 Fixes")
31
- .replace("### Chore", "### 🏡 Chore")
32
- .replace("### Performance Improvements", "### 🔥 Performance");
33
-
34
- return line;
35
- });
36
-
37
- return lines.join("\n");
38
- });
39
-
40
- await filePaths.forEach((file, idx) => {
41
- writeFileSync(file, changelogs[idx]);
42
- });
43
- };
@@ -1,33 +0,0 @@
1
- import { lerna } from "src/scripts/lerna";
2
- import { git } from "src/scripts/git";
3
- import type { VersionOptions } from "./VersionOptions";
4
- import { log } from "./log";
5
- import { getPreid } from "./getPreid";
6
- import { pimpChangelogs } from "./pimpChangelogs";
7
-
8
- export const version = async (options: VersionOptions) => {
9
- const { pre, dev, changelog, commit, yes } = options;
10
-
11
- lerna.version({
12
- conventionalCommits: true,
13
- conventionalGraduate: (!dev && !pre) || undefined,
14
- conventionalPrerelease: !!dev || !!pre || undefined,
15
- preid: dev ? "dev" : getPreid(pre),
16
- includeMergedTags: true,
17
- gitTagVersion: false,
18
- private: false,
19
- push: false,
20
- changelog,
21
- yes,
22
- });
23
-
24
- if (changelog) await pimpChangelogs();
25
-
26
- if (commit) {
27
- log.info("Commit changes.");
28
- const msg = commit === true ? "chore: Prepare Release" : commit;
29
- git.commit({
30
- m: msg,
31
- });
32
- }
33
- };
package/src/constants.ts DELETED
@@ -1,5 +0,0 @@
1
- import { bin, version } from "../package.json";
2
-
3
- export const PROGRAM_NAME = Object.keys(bin)[0];
4
- export const VERSION = version;
5
- export const CONFIG_FILE = `${PROGRAM_NAME}.json`;
package/src/index.ts DELETED
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env node
2
- import { program } from "commander";
3
- import { PROGRAM_NAME, VERSION } from "./constants";
4
- import commands from "./commands";
5
- import { preAction } from "./preAction";
6
-
7
- program
8
- .name(PROGRAM_NAME)
9
- .description(
10
- "A collection of commands and scripts for helping running, building, deploying and assisting in developing with Gluhar, Vue, Nuxt, Tailwind & Sanity."
11
- )
12
- .version(VERSION, "-v, --version", "Output the version number.")
13
- .helpOption("-h, --help", "Display help for a command.")
14
- .option("-l, --log-level <level>", "Set log level.", "info")
15
- .option("-lp, --log-prefix <prefixes...>", "Set log prefixes.")
16
- .option("--ci", "Enable CI mode. Full logging and no prompts.", false)
17
- .option("--cwd <path>", "The current working directory for the scripts.")
18
- .usage("<command> [options]")
19
- .hook("preAction", preAction)
20
- .action(() => program.outputHelp());
21
-
22
- commands.forEach((cmd) => program.addCommand(cmd));
23
-
24
- program.parse(process.argv);
package/src/preAction.ts DELETED
@@ -1,93 +0,0 @@
1
- import { existsSync } from "fs";
2
- import type { Command } from "commander";
3
- import { confirmQuestion, init, logger } from "./utils";
4
- import type { GlobalOptions } from "./GlobalOptions";
5
- import { cmd, executeCmd, getCmdOutput } from "./scripts/cmd";
6
- import { PROGRAM_NAME, VERSION } from "./constants";
7
- import { git } from "./scripts/git";
8
- // import { getConfigOpt, setConfigOpt } from './config';
9
-
10
- const getOptions = <T>(command: Command) => command.opts() as T;
11
- const log = logger("cli");
12
-
13
- // const loadConfig = (rootCmd: Command, actionCmd: Command) => {
14
- // const config = getConfigOpt(actionCmd.name());
15
- // setConfigOpt(config, rootCmd, actionCmd);
16
- // };
17
-
18
- const setupCi = (rootCmd: Command, actionCmd: Command) => {
19
- const { ci } = getOptions<GlobalOptions>(rootCmd);
20
- const ciSource = rootCmd.getOptionValueSource("ci") ?? "implied";
21
-
22
- if (ci) {
23
- rootCmd.setOptionValueWithSource("yes", true, ciSource);
24
- actionCmd.setOptionValueWithSource("yes", true, ciSource);
25
- rootCmd.setOptionValueWithSource("logLevel", "verbose", ciSource);
26
- rootCmd.setOptionValueWithSource("logPrefix", undefined, ciSource);
27
- }
28
- };
29
-
30
- const setupLogging = (rootCmd: Command) => {
31
- const { logLevel, logPrefix } = getOptions<GlobalOptions>(rootCmd);
32
- init(PROGRAM_NAME, logLevel, logPrefix);
33
- };
34
-
35
- const setup = (rootCmd: Command, actionCmd: Command) => {
36
- setupCi(rootCmd, actionCmd);
37
- setupLogging(rootCmd);
38
- };
39
-
40
- const logCli = (actionCmd: Command) => {
41
- log.notice(`v${VERSION}`);
42
-
43
- log.verbose("Calling command:", actionCmd.name());
44
- log.verbose("arguments:", actionCmd.args);
45
- log.verbose("options:", getOptions(actionCmd));
46
- log.verbose("cwd:", process.cwd());
47
- };
48
-
49
- const checkCliVersion = async () => {
50
- const hasGit = existsSync(".git");
51
- if (hasGit && git.getRepo() === "gluhar") return;
52
-
53
- const latestVersion = getCmdOutput("npm show @gluhar/cli version");
54
-
55
- // Version is up to date
56
- if (latestVersion === VERSION) return;
57
-
58
- // Version is old, ask to install latest
59
- const installLatest = await confirmQuestion(
60
- `There is a newer version of the gluhar/cli available (v${latestVersion}). \nDo you want to install it now? (npm i -g @gluhar/cli)`
61
- );
62
- if (installLatest) {
63
- executeCmd("npm i -g @gluhar/cli@latest");
64
-
65
- // If we are in a project, also update the local version
66
- const isLocal = !getCmdOutput("npm list @gluhar/cli --depth=0").includes(
67
- "empty"
68
- );
69
- if (isLocal) executeCmd("npm update @gluhar/cli");
70
- }
71
- };
72
-
73
- export const preAction = async (rootCmd: Command, actionCmd: Command) => {
74
- // setup logging before loadConfig, so we can get logging from loadConfig
75
- setup(rootCmd, actionCmd);
76
-
77
- const { cwd: initCwd } = getOptions<GlobalOptions>(rootCmd);
78
- if (initCwd) cmd.cd(initCwd);
79
-
80
- // Check for newer cli version
81
- await checkCliVersion();
82
-
83
- // loadConfig(rootCmd, actionCmd);
84
-
85
- const { cwd: newCwd } = getOptions<GlobalOptions>(rootCmd);
86
- if (newCwd && newCwd !== initCwd) cmd.cd(newCwd);
87
-
88
- // setup logging after loadConfig so we apply options from config
89
- setup(rootCmd, actionCmd);
90
-
91
- logCli(actionCmd);
92
- if (initCwd) log.notice("from", initCwd);
93
- };
@@ -1,9 +0,0 @@
1
- import shell from 'shelljs';
2
- import { log } from './log';
3
-
4
- export const cd = (path: string) => {
5
- const oldDir = process.cwd();
6
- shell.cd(path);
7
- const newDir = process.cwd();
8
- log.verbose(`cd ${path}: ${oldDir} -> ${newDir}`);
9
- };
@@ -1,23 +0,0 @@
1
- import { spawnSync } from 'child_process';
2
- import { log } from './log';
3
- import type { Args } from './types';
4
- import { parseArgs } from './parseArgs';
5
-
6
- /**
7
- * Function that executes a bash script from string.
8
- * @param cmd A one-line string of a bash command: 'npm install'.
9
- * @param args Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
10
- * @returns Executes the bash script in the same stdio.
11
- */
12
- export const executeCmd = (cmd: string, args?: Args) => {
13
- const cmdArgs = [cmd];
14
- if (args) {
15
- cmdArgs.push(...parseArgs(args));
16
- }
17
-
18
- const fullCmd = cmdArgs.join(' ');
19
- log.verbose('executeCmd:', fullCmd);
20
- return spawnSync(fullCmd, { stdio: 'inherit', shell: true });
21
- };
22
-
23
- // TODO make an async option
@@ -1,26 +0,0 @@
1
- import { execSync } from 'child_process';
2
- import { log } from './log';
3
- import type { Args } from './types';
4
- import { parseArgs } from './parseArgs';
5
-
6
- /**
7
- * A function that runs a bash script from a string and returns the output.
8
- * Mainly used in js logic if you want the output of a bash script.
9
- * @param cmd A one-line string of a bash command: 'npm install'.
10
- * @param args Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
11
- * @returns The output of the command as a string.
12
- */
13
- export const getCmdOutput = (cmd: string, args?: Args) => {
14
- const cmdArgs = [cmd];
15
- if (args) {
16
- cmdArgs.push(...parseArgs(args));
17
- }
18
-
19
- const fullCmd = cmdArgs.join(' ');
20
- log.verbose('getCmdOutput:', fullCmd);
21
- return execSync(fullCmd).toString().trim();
22
- };
23
-
24
- // TODO make an async option
25
- // TODO get output from a script file?
26
- // TODO maybe utilise the other two function instead of execSync?
@@ -1,3 +0,0 @@
1
- import { logger } from 'src/utils';
2
-
3
- export const log = logger('cmd');
@@ -1,44 +0,0 @@
1
- import humps from "humps";
2
- import type { Args, NotNullableProps, ParsedArg } from "./types";
3
-
4
- const hyphenize = (s: string) => humps.decamelize(s, { separator: "-" });
5
-
6
- const hasValue = (arg: ParsedArg): arg is NotNullableProps<ParsedArg> => {
7
- return arg.value !== undefined;
8
- };
9
-
10
- export const parseArgs = (args: Args): string[] => {
11
- return Object.entries(args)
12
- .map(
13
- ([name, value]): ParsedArg => ({
14
- name,
15
- parsedName: hyphenize(name),
16
- value,
17
- parsedValue: JSON.stringify(value),
18
- })
19
- )
20
- .filter(hasValue)
21
- .reduce((result, { name, parsedName, value, parsedValue }) => {
22
- if (name.length > 1) {
23
- result.push(`--${parsedName}`);
24
- } else {
25
- result.push(`-${parsedName}`);
26
- }
27
- value.toString();
28
-
29
- if (value !== true) {
30
- let v = parsedValue;
31
- if (
32
- v.length > 2 &&
33
- v[0] === '"' &&
34
- v[v.length - 1] === '"' &&
35
- !v.includes(" ")
36
- )
37
- v = v.slice(1, -1);
38
-
39
- result.push(v);
40
- }
41
-
42
- return result;
43
- }, [] as string[]);
44
- };
@@ -1,21 +0,0 @@
1
- import { log } from './log';
2
- import type { Args } from './types';
3
- import { parseArgs } from './parseArgs';
4
-
5
- export const parseBashArgs = (
6
- path: string,
7
- args?: Args,
8
- absolute?: boolean,
9
- ) => {
10
- const filePath = path.endsWith('.sh') ? path : `${path}.sh`;
11
- const absolutePath = !absolute ? `${__dirname}/../${filePath}` : filePath;
12
- const flags = [absolutePath];
13
-
14
- if (args) {
15
- flags.push(...parseArgs(args));
16
- }
17
-
18
- log.verbose('executeBash:', flags.join(' '));
19
-
20
- return flags;
21
- };
@@ -1,13 +0,0 @@
1
- export type ArgValue = string | number | boolean;
2
- export type Args = Record<string, ArgValue | undefined> | {};
3
-
4
- export interface ParsedArg {
5
- name: string;
6
- parsedName: string;
7
- value: ArgValue | undefined;
8
- parsedValue: string | undefined;
9
- }
10
-
11
- export type NotNullableProps<T> = {
12
- [K in keyof T]: NonNullable<T[K]>;
13
- };
@@ -1,29 +0,0 @@
1
- import { join, relative } from "path";
2
- import { copyFiles, FileInfoUpdate } from "./copyFiles";
3
- import { log } from "./log";
4
-
5
- /**
6
- * Function that copies all files recursively from one dir to another allowing to update their content in the process.
7
- * @param sourcePath Directory of files to copy recursively.
8
- * @param destinationPath Destination directory to place files.
9
- * @param updateContent Optional function that updates the contents of each file.
10
- */
11
- export const copyDir = (
12
- sourcePath: string,
13
- destinationPath: string,
14
- updateFile?: FileInfoUpdate
15
- ) => {
16
- log.verbose("copyDir", { sourcePath, destinationPath });
17
- const glob = join(sourcePath, "**", "*.*");
18
-
19
- return copyFiles([glob], (file) => {
20
- const newDir = join(destinationPath, relative(sourcePath, file.dir));
21
- log.verbose("copyDir file from", file.dir, "to", newDir);
22
- const f = updateFile ? updateFile(file) : file;
23
-
24
- return {
25
- ...f,
26
- dir: newDir,
27
- };
28
- });
29
- };
@@ -1,75 +0,0 @@
1
- import { mkdir, readFile, writeFile } from "fs/promises";
2
- import { glob } from "glob";
3
- import { type ParsedPath, parse, resolve, format } from "path";
4
- import { exists } from "fs-extra";
5
- import { log } from "./log";
6
-
7
- export interface FileInfo extends Omit<ParsedPath, "root"> {
8
- name: string;
9
- content: string;
10
- encoding: BufferEncoding;
11
- }
12
-
13
- export type FileInfoUpdate = (fileInfo: FileInfo) => Partial<FileInfo>;
14
-
15
- export const loadFiles = async (globs: string[]): Promise<FileInfo[]> => {
16
- const { isText } = await import("istextorbinary");
17
-
18
- log.verbose("Globs:", globs);
19
- const filePaths = await glob(globs, {
20
- nodir: true,
21
- dot: true,
22
- nocase: true,
23
- });
24
- log.verbose("Loaded files:", filePaths.length);
25
-
26
- const files = filePaths.map(async (path): Promise<FileInfo> => {
27
- const encoding = isText(path) ? "utf-8" : "binary";
28
-
29
- return {
30
- ...parse(path),
31
- content: await readFile(path, encoding),
32
- encoding,
33
- };
34
- });
35
-
36
- return Promise.all(files);
37
- };
38
-
39
- export const updateFiles = (
40
- files: FileInfo[],
41
- update: FileInfoUpdate
42
- ): FileInfo[] => {
43
- return files.map((original): FileInfo => {
44
- log.verbose("Updating file", original.dir, original.base);
45
- const updated = update(original);
46
- return {
47
- ...original,
48
- ...updated,
49
- };
50
- });
51
- };
52
-
53
- const getPath = (relative: string) => resolve(process.cwd(), relative);
54
-
55
- const write = async (files: FileInfo[]) => {
56
- const writes = files.map(async (file) => {
57
- const dirPath = getPath(file.dir);
58
- const dirExists = await exists(dirPath);
59
- if (!dirExists) {
60
- await mkdir(dirPath, { recursive: true });
61
- }
62
-
63
- const filePath = getPath(format(file));
64
- log.verbose("Writing file", filePath);
65
- await writeFile(filePath, file.content, file.encoding);
66
- });
67
-
68
- await Promise.all(writes);
69
- };
70
-
71
- export const copyFiles = async (globs: string[], update: FileInfoUpdate) => {
72
- const files = await loadFiles(globs);
73
- const updatedFiles = updateFiles(files, update);
74
- await write(updatedFiles);
75
- };