tnp-helpers 19.0.5 → 19.0.7

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 (197) hide show
  1. package/browser/fesm2022/tnp-helpers.mjs +2399 -234
  2. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  3. package/browser/lib/base/linked-project.d.ts +4 -1
  4. package/browser/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +6 -6
  5. package/browser/lib/build-info._auto-generated_.d.ts +2 -1
  6. package/browser/lib/helpers/helpers.d.ts +1 -0
  7. package/browser/lib/index.d.ts +3 -1
  8. package/browser/lib/old/execute-command.d.ts +12 -0
  9. package/browser/lib/old/helpers.d.ts +62 -0
  10. package/browser/lib/old/models.d.ts +81 -0
  11. package/browser/lib/utils.d.ts +42 -21
  12. package/browser/package.json +1 -1
  13. package/client/fesm2022/tnp-helpers.mjs +2399 -234
  14. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  15. package/client/lib/base/linked-project.d.ts +4 -1
  16. package/client/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +6 -6
  17. package/client/lib/build-info._auto-generated_.d.ts +2 -1
  18. package/client/lib/helpers/helpers.d.ts +1 -0
  19. package/client/lib/index.d.ts +3 -1
  20. package/client/lib/old/execute-command.d.ts +12 -0
  21. package/client/lib/old/helpers.d.ts +62 -0
  22. package/client/lib/old/models.d.ts +81 -0
  23. package/client/lib/utils.d.ts +42 -21
  24. package/client/package.json +1 -1
  25. package/lib/base/classes/base-bower-json.js +2 -2
  26. package/lib/base/classes/base-bower-json.js.map +1 -1
  27. package/lib/base/classes/base-cli-worker/base-cli-worker-config.js +2 -2
  28. package/lib/base/classes/base-cli-worker/base-cli-worker-config.js.map +1 -1
  29. package/lib/base/classes/base-cli-worker/base-cli-worker-controller.d.ts +1 -1
  30. package/lib/base/classes/base-cli-worker/base-cli-worker-controller.js +14 -14
  31. package/lib/base/classes/base-cli-worker/base-cli-worker-controller.js.map +1 -1
  32. package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js +10 -10
  33. package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js.map +1 -1
  34. package/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +1 -1
  35. package/lib/base/classes/base-cli-worker/base-cli-worker.js +18 -18
  36. package/lib/base/classes/base-cli-worker/base-cli-worker.js.map +1 -1
  37. package/lib/base/classes/base-command-line-feature.backend.js +10 -10
  38. package/lib/base/classes/base-command-line-feature.backend.js.map +1 -1
  39. package/lib/base/classes/base-compiler-for-project.d.ts +1 -1
  40. package/lib/base/classes/base-compiler-for-project.js +13 -13
  41. package/lib/base/classes/base-compiler-for-project.js.map +1 -1
  42. package/lib/base/classes/base-db.js +7 -7
  43. package/lib/base/classes/base-db.js.map +1 -1
  44. package/lib/base/classes/base-debounce-compiler-for-project.d.ts +1 -1
  45. package/lib/base/classes/base-debounce-compiler-for-project.js +5 -5
  46. package/lib/base/classes/base-debounce-compiler-for-project.js.map +1 -1
  47. package/lib/base/classes/base-git.js +26 -25
  48. package/lib/base/classes/base-git.js.map +1 -1
  49. package/lib/base/classes/base-global-command-line.backend.d.ts +3 -1
  50. package/lib/base/classes/base-global-command-line.backend.js +60 -49
  51. package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
  52. package/lib/base/classes/base-ignore-hide.js +2 -2
  53. package/lib/base/classes/base-ignore-hide.js.map +1 -1
  54. package/lib/base/classes/base-json-file-reader.js +24 -24
  55. package/lib/base/classes/base-json-file-reader.js.map +1 -1
  56. package/lib/base/classes/base-library-build.js +52 -52
  57. package/lib/base/classes/base-library-build.js.map +1 -1
  58. package/lib/base/classes/base-linked-projects.js +23 -23
  59. package/lib/base/classes/base-linked-projects.js.map +1 -1
  60. package/lib/base/classes/base-node-modules.js +37 -37
  61. package/lib/base/classes/base-node-modules.js.map +1 -1
  62. package/lib/base/classes/base-npm-helpers.d.ts +1 -1
  63. package/lib/base/classes/base-npm-helpers.js +14 -14
  64. package/lib/base/classes/base-npm-helpers.js.map +1 -1
  65. package/lib/base/classes/base-package-json.d.ts +1 -1
  66. package/lib/base/classes/base-package-json.js +27 -27
  67. package/lib/base/classes/base-package-json.js.map +1 -1
  68. package/lib/base/classes/base-powershell.js +7 -2
  69. package/lib/base/classes/base-powershell.js.map +1 -1
  70. package/lib/base/classes/base-process-manager.js +8 -8
  71. package/lib/base/classes/base-process-manager.js.map +1 -1
  72. package/lib/base/classes/base-project-resolver.js +34 -33
  73. package/lib/base/classes/base-project-resolver.js.map +1 -1
  74. package/lib/base/classes/base-project.d.ts +1 -1
  75. package/lib/base/classes/base-project.js +62 -62
  76. package/lib/base/classes/base-project.js.map +1 -1
  77. package/lib/base/classes/base-quick-fixes.js +9 -9
  78. package/lib/base/classes/base-quick-fixes.js.map +1 -1
  79. package/lib/base/classes/base-release-process.d.ts +1 -1
  80. package/lib/base/classes/base-release-process.js +19 -19
  81. package/lib/base/classes/base-release-process.js.map +1 -1
  82. package/lib/base/classes/base-start-config.backend.js +13 -13
  83. package/lib/base/classes/base-start-config.backend.js.map +1 -1
  84. package/lib/base/classes/base-static-pages.js +6 -6
  85. package/lib/base/classes/base-static-pages.js.map +1 -1
  86. package/lib/base/classes/base-vscode.js +31 -24
  87. package/lib/base/classes/base-vscode.js.map +1 -1
  88. package/lib/base/commit-data.js +25 -25
  89. package/lib/base/commit-data.js.map +1 -1
  90. package/lib/base/core-project.d.ts +1 -1
  91. package/lib/base/core-project.js +9 -9
  92. package/lib/base/core-project.js.map +1 -1
  93. package/lib/base/gh-temp-code.js +6 -6
  94. package/lib/base/gh-temp-code.js.map +1 -1
  95. package/lib/base/index-rebuilder.backend.js +1 -1
  96. package/lib/base/index-rebuilder.backend.js.map +1 -1
  97. package/lib/base/linked-project.d.ts +4 -1
  98. package/lib/base/linked-project.js +18 -9
  99. package/lib/base/linked-project.js.map +1 -1
  100. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
  101. package/lib/base/tcp-udp-ports/ports.controller.d.ts +1 -1
  102. package/lib/base/tcp-udp-ports/ports.controller.js +21 -21
  103. package/lib/base/tcp-udp-ports/ports.controller.js.map +1 -1
  104. package/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  105. package/lib/base/tcp-udp-ports/ports.entity.js +10 -10
  106. package/lib/base/tcp-udp-ports/ports.entity.js.map +1 -1
  107. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +9 -9
  108. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js +9 -9
  109. package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js.map +1 -1
  110. package/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.js +18 -18
  111. package/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.js.map +1 -1
  112. package/lib/build-info._auto-generated_.d.ts +2 -1
  113. package/lib/build-info._auto-generated_.js +3 -2
  114. package/lib/build-info._auto-generated_.js.map +1 -1
  115. package/lib/helpers/for-backend/helpers-cli-tool.backend.js +40 -40
  116. package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
  117. package/lib/helpers/for-backend/helpers-console-gui.js +2 -2
  118. package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
  119. package/lib/helpers/for-backend/helpers-dependencies.backend.js +2 -2
  120. package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -1
  121. package/lib/helpers/for-backend/helpers-file-folders.js +131 -131
  122. package/lib/helpers/for-backend/helpers-file-folders.js.map +1 -1
  123. package/lib/helpers/for-backend/helpers-git.backend.js +120 -106
  124. package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
  125. package/lib/helpers/for-backend/helpers-network.backend.js +2 -3
  126. package/lib/helpers/for-backend/helpers-network.backend.js.map +1 -1
  127. package/lib/helpers/for-backend/helpers-npm.backend.js +2 -2
  128. package/lib/helpers/for-backend/helpers-npm.backend.js.map +1 -1
  129. package/lib/helpers/for-backend/helpers-path.backend.js +6 -6
  130. package/lib/helpers/for-backend/helpers-path.backend.js.map +1 -1
  131. package/lib/helpers/for-backend/helpers-process.d.ts +1 -1
  132. package/lib/helpers/for-backend/helpers-process.js +41 -41
  133. package/lib/helpers/for-backend/helpers-process.js.map +1 -1
  134. package/lib/helpers/for-backend/helpers-system-terminal.backend.js +2 -2
  135. package/lib/helpers/for-backend/helpers-system-terminal.backend.js.map +1 -1
  136. package/lib/helpers/for-backend/helpers-vscode.backend.d.ts +1 -1
  137. package/lib/helpers/for-backend/helpers-vscode.backend.js +2 -2
  138. package/lib/helpers/for-backend/helpers-vscode.backend.js.map +1 -1
  139. package/lib/helpers/for-browser/angular.helper.js +2 -2
  140. package/lib/helpers/helpers-array-obj.js +10 -10
  141. package/lib/helpers/helpers-array-obj.js.map +1 -1
  142. package/lib/helpers/helpers-json5.backend.js +6 -6
  143. package/lib/helpers/helpers-json5.backend.js.map +1 -1
  144. package/lib/helpers/helpers-numbers.js.map +1 -1
  145. package/lib/helpers/helpers-strings-regexes.js +5 -5
  146. package/lib/helpers/helpers-strings-regexes.js.map +1 -1
  147. package/lib/helpers/helpers-strings.js +3 -3
  148. package/lib/helpers/helpers-strings.js.map +1 -1
  149. package/lib/helpers/helpers.d.ts +1 -0
  150. package/lib/helpers/helpers.js +42 -30
  151. package/lib/helpers/helpers.js.map +1 -1
  152. package/lib/index.js +0 -2
  153. package/lib/index.js.map +1 -1
  154. package/lib/lowdb/adapters/node/TextFile.js +2 -2
  155. package/lib/lowdb/adapters/node/TextFile.js.map +1 -1
  156. package/lib/models.d.ts +1 -1
  157. package/lib/models.js +8 -8
  158. package/lib/models.js.map +1 -1
  159. package/lib/old/base-component.js +2 -2
  160. package/lib/old/base-formly-component.js +2 -2
  161. package/lib/old/dual-component-ctrl.js +2 -2
  162. package/lib/old/execute-command.js +20 -8
  163. package/lib/old/execute-command.js.map +1 -1
  164. package/lib/old/helpers.js +2 -2
  165. package/lib/old/helpers.js.map +1 -1
  166. package/lib/old/models.d.ts +1 -1
  167. package/lib/utils.d.ts +42 -21
  168. package/lib/utils.js +340 -54
  169. package/lib/utils.js.map +1 -1
  170. package/lib/validators/validators-firedev.js +6 -6
  171. package/lib/validators/validators-firedev.js.map +1 -1
  172. package/lib/validators/validators-git.js.map +1 -1
  173. package/lib/validators/validators-network.js +2 -2
  174. package/lib/validators/validators-network.js.map +1 -1
  175. package/migrations/1736198527297_init.d.ts +1 -1
  176. package/migrations/1736198527297_init.js +5 -5
  177. package/migrations/1736198527297_init.js.map +1 -1
  178. package/migrations/1736199486472_addingNotAssignablePorts.d.ts +1 -1
  179. package/migrations/1736199486472_addingNotAssignablePorts.js +8 -8
  180. package/migrations/1736199486472_addingNotAssignablePorts.js.map +1 -1
  181. package/migrations/1736454437350_addFreePorts.d.ts +1 -1
  182. package/migrations/1736454437350_addFreePorts.js +11 -11
  183. package/migrations/1736454437350_addFreePorts.js.map +1 -1
  184. package/package.json +1 -1
  185. package/tmp-environment.json +4 -4
  186. package/websql/fesm2022/tnp-helpers.mjs +2436 -238
  187. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  188. package/websql/lib/base/linked-project.d.ts +4 -1
  189. package/websql/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +6 -6
  190. package/websql/lib/build-info._auto-generated_.d.ts +2 -1
  191. package/websql/lib/helpers/helpers.d.ts +1 -0
  192. package/websql/lib/index.d.ts +3 -1
  193. package/websql/lib/old/execute-command.d.ts +12 -0
  194. package/websql/lib/old/helpers.d.ts +62 -0
  195. package/websql/lib/old/models.d.ts +81 -0
  196. package/websql/lib/utils.d.ts +42 -21
  197. package/websql/package.json +1 -1
@@ -4,9 +4,9 @@ exports.HelpersGit = void 0;
4
4
  //#region imports
5
5
  const ini = require("ini");
6
6
  const simple_git_1 = require("simple-git");
7
- const tnp_config_1 = require("tnp-config");
8
- const tnp_core_1 = require("tnp-core");
9
- const tnp_core_2 = require("tnp-core");
7
+ const lib_1 = require("tnp-config/lib");
8
+ const lib_2 = require("tnp-core/lib");
9
+ const lib_3 = require("tnp-core/lib");
10
10
  const index_1 = require("../../index");
11
11
  //#endregion
12
12
  class HelpersGit {
@@ -28,7 +28,7 @@ class HelpersGit {
28
28
  // const lastCommitHash = this.project.git.lastCommitHash();
29
29
  // this.project.packageJson.setBuildHash(lastCommitHash);
30
30
  if (autoReleaseUsingConfig ||
31
- (await tnp_core_2.UtilsTerminal.confirm({
31
+ (await lib_3.UtilsTerminal.confirm({
32
32
  message: `Push changes to git repo ?`,
33
33
  defaultValue: true,
34
34
  }))) {
@@ -62,11 +62,11 @@ class HelpersGit {
62
62
  removeTag(cwd, tagName) {
63
63
  //#region @backendFunc
64
64
  try {
65
- tnp_core_1.child_process.execSync(`git tag -d ${tagName}`, { cwd });
65
+ lib_2.child_process.execSync(`git tag -d ${tagName}`, { cwd });
66
66
  index_1.Helpers.info(`Tag "${tagName}" removed successfully.`);
67
67
  }
68
68
  catch (error) {
69
- index_1.Helpers.warn(`[${tnp_config_1.config.frameworkName}-helpers] not able to remove tag ${tagName} in ${cwd}`, true);
69
+ index_1.Helpers.warn(`[${lib_1.config.frameworkName}-helpers] not able to remove tag ${tagName} in ${cwd}`, true);
70
70
  }
71
71
  //#endregion
72
72
  }
@@ -81,7 +81,7 @@ class HelpersGit {
81
81
  index_1.Helpers.log('[taon-helpers][lastcommithash] ' + cwd, 1);
82
82
  try {
83
83
  let hash = this.isInsideGitRepo(cwd) &&
84
- tnp_core_1.child_process
84
+ lib_2.child_process
85
85
  .execSync(`git log -1 --format="%H"`, { cwd })
86
86
  .toString()
87
87
  .trim();
@@ -99,7 +99,7 @@ class HelpersGit {
99
99
  index_1.Helpers.log('[penultimateCommitHash] ' + cwd, 1);
100
100
  try {
101
101
  let hash = this.isInsideGitRepo(cwd) &&
102
- tnp_core_1.child_process
102
+ lib_2.child_process
103
103
  .execSync(`git log -2 --format="%H"`, { cwd })
104
104
  .toString()
105
105
  .trim();
@@ -130,7 +130,7 @@ class HelpersGit {
130
130
  return void 0;
131
131
  }
132
132
  try {
133
- if (process.platform === 'win32' && tnp_core_2.UtilsOs.isRunningInWindowsCmd()) {
133
+ if (process.platform === 'win32' && lib_3.UtilsOs.isRunningInWindowsCmd()) {
134
134
  let tagOnCMd = index_1.Helpers.commnadOutputAsString(`for /f %i in ('git rev-list --tags --max-count=1') do @git describe --tags %i`);
135
135
  console.log({ tagOnCMd });
136
136
  tagOnCMd = tagOnCMd.toString().trim();
@@ -187,10 +187,10 @@ class HelpersGit {
187
187
  // })
188
188
  try {
189
189
  if (process.platform === 'win32') {
190
- tagName = tnp_core_1.child_process.execSync(cm1, { cwd }).toString().trim();
190
+ tagName = lib_2.child_process.execSync(cm1, { cwd }).toString().trim();
191
191
  }
192
192
  else {
193
- tagName = tnp_core_1.child_process.execSync(cm2, { cwd }).toString().trim();
193
+ tagName = lib_2.child_process.execSync(cm2, { cwd }).toString().trim();
194
194
  }
195
195
  if (tagName) {
196
196
  return tagName;
@@ -199,10 +199,10 @@ class HelpersGit {
199
199
  catch (e) { }
200
200
  try {
201
201
  if (process.platform === 'win32') {
202
- tagName = tnp_core_1.child_process.execSync(cm3, { cwd }).toString().trim();
202
+ tagName = lib_2.child_process.execSync(cm3, { cwd }).toString().trim();
203
203
  }
204
204
  else {
205
- tagName = tnp_core_1.child_process.execSync(cm4, { cwd }).toString().trim();
205
+ tagName = lib_2.child_process.execSync(cm4, { cwd }).toString().trim();
206
206
  }
207
207
  if (tagName) {
208
208
  return tagName;
@@ -250,7 +250,7 @@ class HelpersGit {
250
250
  const fixFolders = (files) => {
251
251
  files = files.reduce((acc, curr) => {
252
252
  const newFiles = [curr];
253
- const fullPath = (0, tnp_core_1.crossPlatformPath)([cwd, curr]);
253
+ const fullPath = (0, lib_2.crossPlatformPath)([cwd, curr]);
254
254
  if (index_1.Helpers.isFolder(fullPath)) {
255
255
  newFiles.push(...index_1.Helpers.filesFrom(fullPath, true).map(f => f.replace(cwd + '/', '')));
256
256
  }
@@ -280,7 +280,7 @@ class HelpersGit {
280
280
  if (!tag) {
281
281
  return null;
282
282
  }
283
- let hash = tnp_core_1.child_process
283
+ let hash = lib_2.child_process
284
284
  .execSync(`git log -1 --format=format:"%H" ${tag}`, { cwd })
285
285
  .toString()
286
286
  .trim();
@@ -298,7 +298,7 @@ class HelpersGit {
298
298
  index_1.Helpers.log('[taon-helpers][lastCommitDate] ' + cwd, 1);
299
299
  try {
300
300
  let unixTimestamp = this.isInsideGitRepo(cwd) &&
301
- tnp_core_1.child_process
301
+ lib_2.child_process
302
302
  .execSync(`git log -1 --pretty=format:%ct`, { cwd })
303
303
  .toString()
304
304
  .trim();
@@ -393,7 +393,7 @@ class HelpersGit {
393
393
  lastCommitMessage(cwd) {
394
394
  index_1.Helpers.log('[taon-helpers][lastCommitMessage] ' + cwd, 1);
395
395
  try {
396
- let unixTimestamp = tnp_core_1.child_process
396
+ let unixTimestamp = lib_2.child_process
397
397
  .execSync(`git log -1 --pretty=%B`, { cwd })
398
398
  .toString()
399
399
  .trim();
@@ -445,7 +445,7 @@ class HelpersGit {
445
445
  // child_process.execSync('git rev-parse HEAD', { cwd, stdio: ['pipe',] }).toString().trim()
446
446
  }
447
447
  else {
448
- tnp_core_1.child_process
448
+ lib_2.child_process
449
449
  .execSync('git rev-parse HEAD &> /dev/null', { cwd })
450
450
  .toString()
451
451
  .trim();
@@ -461,7 +461,7 @@ class HelpersGit {
461
461
  isInMergeProcess(cwd) {
462
462
  index_1.Helpers.log('[taon-helpers][hasAnyCommits] ' + cwd, 1);
463
463
  try {
464
- const message = (tnp_core_1.child_process.execSync(`git status`, { cwd }) || '')
464
+ const message = (lib_2.child_process.execSync(`git status`, { cwd }) || '')
465
465
  .toString()
466
466
  .trim();
467
467
  return message.search('Unmerged paths:') !== -1;
@@ -476,7 +476,7 @@ class HelpersGit {
476
476
  index_1.Helpers.log('[taon-helpers][getBranchesNames] ' + cwd, 1);
477
477
  try {
478
478
  let branchPattern = pattern;
479
- if (tnp_core_1._.isString(pattern)) {
479
+ if (lib_2._.isString(pattern)) {
480
480
  branchPattern = new RegExp(pattern.replace(/[^a-zA-Z0-9]+/g, '.*'));
481
481
  }
482
482
  const command = `git branch -a`;
@@ -495,7 +495,7 @@ class HelpersGit {
495
495
  return false;
496
496
  }
497
497
  // console.log('testing: ' + l)
498
- if (tnp_core_1._.isRegExp(branchPattern)) {
498
+ if (lib_2._.isRegExp(branchPattern)) {
499
499
  const match = branchPattern.test(l);
500
500
  return match;
501
501
  }
@@ -517,10 +517,10 @@ class HelpersGit {
517
517
  //#region get all origins
518
518
  allOrigins(cwd) {
519
519
  // Determine the path to the .git/config file
520
- const gitConfigPath = (0, tnp_core_1.crossPlatformPath)([cwd, '.git', 'config']);
520
+ const gitConfigPath = (0, lib_2.crossPlatformPath)([cwd, '.git', 'config']);
521
521
  // Read the contents of the .git/config file synchronously
522
522
  try {
523
- const configFile = tnp_core_1.fse.readFileSync(gitConfigPath, 'utf-8');
523
+ const configFile = lib_2.fse.readFileSync(gitConfigPath, 'utf-8');
524
524
  const config = ini.parse(configFile);
525
525
  // Extract remotes from the config object
526
526
  const remotes = Object.keys(config)
@@ -541,7 +541,7 @@ class HelpersGit {
541
541
  currentBranchName(cwd) {
542
542
  index_1.Helpers.log('[taon-helpers][currentBranchName] ' + cwd, 1);
543
543
  try {
544
- const branchName = tnp_core_1.child_process
544
+ const branchName = lib_2.child_process
545
545
  .execSync(`git rev-parse --abbrev-ref HEAD`, { cwd })
546
546
  .toString()
547
547
  .trim();
@@ -561,10 +561,10 @@ class HelpersGit {
561
561
  //#region commit
562
562
  commit(cwd, commitMessage) {
563
563
  index_1.Helpers.log('[taon-helpers][commit] ' + cwd, 1);
564
- if (!tnp_core_1._.isString(commitMessage)) {
564
+ if (!lib_2._.isString(commitMessage)) {
565
565
  commitMessage = 'update';
566
566
  }
567
- const tempCommitnameFile = (0, tnp_core_1.crossPlatformPath)([
567
+ const tempCommitnameFile = (0, lib_2.crossPlatformPath)([
568
568
  cwd,
569
569
  'tmp-git-commit-name.txt',
570
570
  ]);
@@ -620,30 +620,30 @@ class HelpersGit {
620
620
  if (this.isGitRoot(cwd)) {
621
621
  return cwd;
622
622
  }
623
- let absoluteLocation = (0, tnp_core_1.crossPlatformPath)(cwd);
623
+ let absoluteLocation = (0, lib_2.crossPlatformPath)(cwd);
624
624
  let previousLocation;
625
- if (tnp_core_1.fse.existsSync(absoluteLocation)) {
626
- absoluteLocation = tnp_core_1.fse.realpathSync(absoluteLocation);
625
+ if (lib_2.fse.existsSync(absoluteLocation)) {
626
+ absoluteLocation = lib_2.fse.realpathSync(absoluteLocation);
627
627
  }
628
- if (tnp_core_1.fse.existsSync(absoluteLocation) &&
629
- !tnp_core_1.fse.lstatSync(absoluteLocation).isDirectory()) {
630
- absoluteLocation = tnp_core_1.path.dirname(absoluteLocation);
628
+ if (lib_2.fse.existsSync(absoluteLocation) &&
629
+ !lib_2.fse.lstatSync(absoluteLocation).isDirectory()) {
630
+ absoluteLocation = lib_2.path.dirname(absoluteLocation);
631
631
  }
632
632
  while (true) {
633
- if (tnp_core_1.path.basename(tnp_core_1.path.dirname(absoluteLocation)) ===
634
- tnp_config_1.config.folder.node_modules) {
635
- absoluteLocation = tnp_core_1.path.dirname(tnp_core_1.path.dirname(absoluteLocation));
633
+ if (lib_2.path.basename(lib_2.path.dirname(absoluteLocation)) ===
634
+ lib_1.config.folder.node_modules) {
635
+ absoluteLocation = lib_2.path.dirname(lib_2.path.dirname(absoluteLocation));
636
636
  }
637
637
  if (this.isGitRoot(absoluteLocation)) {
638
638
  break;
639
639
  }
640
640
  previousLocation = absoluteLocation;
641
- const newAbsLocation = tnp_core_1.path.join(absoluteLocation, '..');
642
- if (!tnp_core_1.path.isAbsolute(newAbsLocation)) {
641
+ const newAbsLocation = lib_2.path.join(absoluteLocation, '..');
642
+ if (!lib_2.path.isAbsolute(newAbsLocation)) {
643
643
  return;
644
644
  }
645
- absoluteLocation = (0, tnp_core_1.crossPlatformPath)(tnp_core_1.path.resolve(newAbsLocation));
646
- if (!tnp_core_1.fse.existsSync(absoluteLocation) &&
645
+ absoluteLocation = (0, lib_2.crossPlatformPath)(lib_2.path.resolve(newAbsLocation));
646
+ if (!lib_2.fse.existsSync(absoluteLocation) &&
647
647
  absoluteLocation.split('/').length < 2) {
648
648
  return;
649
649
  }
@@ -657,7 +657,7 @@ class HelpersGit {
657
657
  //#region is git root
658
658
  isGitRoot(cwd) {
659
659
  index_1.Helpers.log('[taon-helpers][isGitRoot] ' + cwd, 1);
660
- if (!tnp_core_1.fse.existsSync((0, tnp_core_1.crossPlatformPath)([cwd, '.git']))) {
660
+ if (!lib_2.fse.existsSync((0, lib_2.crossPlatformPath)([cwd, '.git']))) {
661
661
  return false;
662
662
  }
663
663
  index_1.Helpers.log('[taon-helpers][isGitRepo] ' + cwd, 1);
@@ -674,7 +674,7 @@ class HelpersGit {
674
674
  // rootGitCwd,
675
675
  // cwd
676
676
  // })
677
- return (rootGitCwd && (0, tnp_core_1.crossPlatformPath)(rootGitCwd) === (0, tnp_core_1.crossPlatformPath)(cwd));
677
+ return (rootGitCwd && (0, lib_2.crossPlatformPath)(rootGitCwd) === (0, lib_2.crossPlatformPath)(cwd));
678
678
  }
679
679
  catch (e) {
680
680
  return false;
@@ -703,10 +703,10 @@ class HelpersGit {
703
703
  //#region reset soft HEAD
704
704
  resetSoftHEAD(cwd, HEAD = 1) {
705
705
  try {
706
- tnp_core_1.child_process.execSync(`git reset --soft HEAD~${HEAD}`, { cwd });
706
+ lib_2.child_process.execSync(`git reset --soft HEAD~${HEAD}`, { cwd });
707
707
  }
708
708
  catch (error) {
709
- index_1.Helpers.error(`[${tnp_config_1.config.frameworkName}] not able to soft repository in ${self.location}`);
709
+ index_1.Helpers.error(`[${lib_1.config.frameworkName}] not able to soft repository in ${self.location}`);
710
710
  }
711
711
  }
712
712
  //#endregion
@@ -715,12 +715,12 @@ class HelpersGit {
715
715
  //#region @backendFunc
716
716
  const { HEAD } = options || {};
717
717
  index_1.Helpers.info(`[taon-helpers] [resetHard] ` +
718
- `${tnp_core_1._.isNumber(HEAD) ? `HEAD~${HEAD}` : ''} ${cwd}`);
718
+ `${lib_2._.isNumber(HEAD) ? `HEAD~${HEAD}` : ''} ${cwd}`);
719
719
  try {
720
- tnp_core_1.child_process.execSync(`git reset --hard ${tnp_core_1._.isNumber(HEAD) ? `HEAD~${HEAD}` : ''}`, { cwd });
720
+ lib_2.child_process.execSync(`git reset --hard ${lib_2._.isNumber(HEAD) ? `HEAD~${HEAD}` : ''}`, { cwd });
721
721
  }
722
722
  catch (error) {
723
- index_1.Helpers.error(`[${tnp_config_1.config.frameworkName}] not able to reset repository in ${self.location}`);
723
+ index_1.Helpers.error(`[${lib_1.config.frameworkName}] not able to reset repository in ${self.location}`);
724
724
  }
725
725
  //#endregion
726
726
  }
@@ -728,20 +728,20 @@ class HelpersGit {
728
728
  //#region pull
729
729
  _pull(cwd, options) {
730
730
  let { branchName, defaultHardResetCommits } = options || {};
731
- if (tnp_core_1._.isNumber(defaultHardResetCommits)) {
731
+ if (lib_2._.isNumber(defaultHardResetCommits)) {
732
732
  this.resetHard(cwd, { HEAD: defaultHardResetCommits });
733
733
  }
734
734
  else {
735
735
  this.resetHard(cwd);
736
736
  }
737
- tnp_core_1.child_process.execSync(`git pull --tags --rebase origin ${branchName}`, {
737
+ lib_2.child_process.execSync(`git pull --tags --rebase origin ${branchName}`, {
738
738
  cwd,
739
739
  });
740
740
  }
741
741
  async pullCurrentBranch(cwd, options) {
742
742
  options = options || {};
743
743
  let { askToRetry, exitOnError } = options || {};
744
- if (tnp_core_1._.isUndefined(exitOnError)) {
744
+ if (lib_2._.isUndefined(exitOnError)) {
745
745
  options.exitOnError = true;
746
746
  exitOnError = true;
747
747
  }
@@ -752,10 +752,10 @@ class HelpersGit {
752
752
  index_1.Helpers.log(`askToRetry: ${askToRetry}`);
753
753
  if (this.getOriginURL(cwd) === '') {
754
754
  index_1.Helpers.warn(`Not pulling branch without ` +
755
- `remote origin url.... in folder ${tnp_core_1.path.basename(cwd)}`);
755
+ `remote origin url.... in folder ${lib_2.path.basename(cwd)}`);
756
756
  return;
757
757
  }
758
- index_1.Helpers.info(`[taon-helpers][${(0, tnp_core_1.dateformat)(new Date(), 'dd-mm-yyyy HH:MM:ss')}] Pulling git changes in "${cwd}", origin=${index_1.Helpers.git.getOriginURL(cwd)} `);
758
+ index_1.Helpers.info(`[taon-helpers][${(0, lib_2.dateformat)(new Date(), 'dd-mm-yyyy HH:MM:ss')}] Pulling git changes in "${cwd}", origin=${index_1.Helpers.git.getOriginURL(cwd)} `);
759
759
  let acknowledgeBeforePull = false;
760
760
  while (true) {
761
761
  try {
@@ -767,7 +767,7 @@ class HelpersGit {
767
767
  ...options,
768
768
  branchName: currentLocalBranch,
769
769
  });
770
- index_1.Helpers.info(`[taon-helpers] Branch "${currentLocalBranch}" updated successfully in ${tnp_core_1.path.basename(cwd)}`);
770
+ index_1.Helpers.info(`[taon-helpers] Branch "${currentLocalBranch}" updated successfully in ${lib_2.path.basename(cwd)}`);
771
771
  break;
772
772
  }
773
773
  catch (e) {
@@ -797,7 +797,7 @@ class HelpersGit {
797
797
  name: 'Exit process',
798
798
  },
799
799
  };
800
- const whatToDo = await tnp_core_2.UtilsTerminal.select({
800
+ const whatToDo = await lib_3.UtilsTerminal.select({
801
801
  question: 'What to do ?',
802
802
  choices: pullOptions,
803
803
  });
@@ -826,7 +826,7 @@ class HelpersGit {
826
826
  }
827
827
  }
828
828
  }
829
- index_1.Helpers.info(`[${(0, tnp_core_1.dateformat)(new Date(), 'dd-mm-yyyy HH:MM:ss')}] DONE PULLING`);
829
+ index_1.Helpers.info(`[${(0, lib_2.dateformat)(new Date(), 'dd-mm-yyyy HH:MM:ss')}] DONE PULLING`);
830
830
  }
831
831
  //#endregion
832
832
  //#region melts action commits
@@ -873,12 +873,12 @@ ${cwd}
873
873
  while (true) {
874
874
  try {
875
875
  const taskName = `
876
- [${(0, tnp_core_1.dateformat)(new Date(), 'dd-mm-yyyy HH:MM:ss')}]
876
+ [${(0, lib_2.dateformat)(new Date(), 'dd-mm-yyyy HH:MM:ss')}]
877
877
  Pushing ${force ? 'FORCE' : 'NORMALLY'} current branch (remote=${origin}): ${currentBranchName}
878
878
  `;
879
879
  index_1.Helpers.info(taskName);
880
880
  const command = `git push ${force ? '-f' : ''} ${origin} ${currentBranchName} --tags`;
881
- index_1.Helpers.info(`[git][push] [${(0, tnp_core_1.dateformat)(new Date(), 'dd-mm-yyyy HH:MM:ss')}] ${force ? 'force' : 'normal'} pushing current branch ${currentBranchName} ,` +
881
+ index_1.Helpers.info(`[git][push] [${(0, lib_2.dateformat)(new Date(), 'dd-mm-yyyy HH:MM:ss')}] ${force ? 'force' : 'normal'} pushing current branch ${currentBranchName} ,` +
882
882
  ` origin=${index_1.Helpers.git.getOriginURL(cwd, origin)}`);
883
883
  index_1.Helpers.run(command, { cwd }).sync();
884
884
  index_1.Helpers.info(taskName);
@@ -907,7 +907,7 @@ ${cwd}
907
907
  name: 'Exit process',
908
908
  },
909
909
  };
910
- const whatToDo = await tnp_core_2.UtilsTerminal.select({
910
+ const whatToDo = await lib_3.UtilsTerminal.select({
911
911
  question: 'What to do ?',
912
912
  choices: pushOptions,
913
913
  });
@@ -936,7 +936,7 @@ ${cwd}
936
936
  //#region @backendFunc
937
937
  index_1.Helpers.log('[defaultRepoBranch] ' + cwd, 1);
938
938
  try {
939
- const raw = tnp_core_1.child_process
939
+ const raw = lib_2.child_process
940
940
  .execSync(`git symbolic-ref refs/remotes/origin/HEAD`, { cwd })
941
941
  .toString()
942
942
  .trim();
@@ -957,11 +957,11 @@ ${cwd}
957
957
  //#region checkout default branch
958
958
  checkoutDefaultBranch(cwd) {
959
959
  index_1.Helpers.log('[checkoutDefaultBranch] ' + cwd, 1);
960
- const defaultBranch = tnp_core_1.child_process
960
+ const defaultBranch = lib_2.child_process
961
961
  .execSync(`git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'`, { cwd })
962
962
  .toString()
963
963
  .trim();
964
- tnp_core_1.child_process.execSync(`git checkout ${defaultBranch}`, { cwd });
964
+ lib_2.child_process.execSync(`git checkout ${defaultBranch}`, { cwd });
965
965
  }
966
966
  //#endregion
967
967
  //#region add
@@ -972,7 +972,7 @@ ${cwd}
972
972
  */
973
973
  stageAllFiles(cwd) {
974
974
  try {
975
- tnp_core_1.child_process.execSync(`git add --all .`, { cwd });
975
+ lib_2.child_process.execSync(`git add --all .`, { cwd });
976
976
  }
977
977
  catch (error) { }
978
978
  }
@@ -985,7 +985,7 @@ ${cwd}
985
985
  */
986
986
  stageFile(cwd, fileRelativePath) {
987
987
  try {
988
- tnp_core_1.child_process.execSync(`git add ${fileRelativePath}`, { cwd });
988
+ lib_2.child_process.execSync(`git add ${fileRelativePath}`, { cwd });
989
989
  }
990
990
  catch (error) { }
991
991
  }
@@ -1001,10 +1001,10 @@ ${cwd}
1001
1001
  // console.log({ onlyStaged, cwd });
1002
1002
  try {
1003
1003
  if (onlyStaged) {
1004
- tnp_core_1.child_process.execSync(`git stash push --staged`, { cwd });
1004
+ lib_2.child_process.execSync(`git stash push --staged`, { cwd });
1005
1005
  }
1006
1006
  else {
1007
- tnp_core_1.child_process.execSync(`git stash -u`, { cwd });
1007
+ lib_2.child_process.execSync(`git stash -u`, { cwd });
1008
1008
  }
1009
1009
  }
1010
1010
  catch (error) {
@@ -1022,7 +1022,7 @@ ${cwd}
1022
1022
  rebase(cwd, toBranch) {
1023
1023
  // console.log({ onlyStaged, cwd });
1024
1024
  try {
1025
- tnp_core_1.child_process.execSync(`git rebase ${toBranch}`, { cwd });
1025
+ lib_2.child_process.execSync(`git rebase ${toBranch}`, { cwd });
1026
1026
  }
1027
1027
  catch (error) {
1028
1028
  index_1.Helpers.info('Not able to rebase');
@@ -1033,7 +1033,7 @@ ${cwd}
1033
1033
  //#region stash apply
1034
1034
  stashApply(cwd) {
1035
1035
  try {
1036
- tnp_core_1.child_process.execSync(`git stash apply`, { cwd });
1036
+ lib_2.child_process.execSync(`git stash apply`, { cwd });
1037
1037
  }
1038
1038
  catch (error) { }
1039
1039
  }
@@ -1042,7 +1042,7 @@ ${cwd}
1042
1042
  fetch(cwd, all = false) {
1043
1043
  index_1.Helpers.taskStarted('Fetching git changes');
1044
1044
  try {
1045
- tnp_core_1.child_process.execSync(`git fetch ${all ? '--all' : ''}`, { cwd });
1045
+ lib_2.child_process.execSync(`git fetch ${all ? '--all' : ''}`, { cwd });
1046
1046
  }
1047
1047
  catch (error) {
1048
1048
  index_1.Helpers.error('Not able to git fetch.', false, true);
@@ -1052,18 +1052,18 @@ ${cwd}
1052
1052
  //#endregion
1053
1053
  cleanRepoFromAnyFilesExceptDotGitFolder(cwd) {
1054
1054
  //#region @backendFunc
1055
- const entries = tnp_core_1.fse.readdirSync(cwd);
1055
+ const entries = lib_2.fse.readdirSync(cwd);
1056
1056
  for (const entry of entries) {
1057
1057
  // Skip the .git directory
1058
1058
  if (entry === '.git') {
1059
1059
  continue;
1060
1060
  }
1061
- const fullPath = (0, tnp_core_1.crossPlatformPath)([cwd, entry]);
1062
- const stats = tnp_core_1.fse.statSync(fullPath);
1061
+ const fullPath = (0, lib_2.crossPlatformPath)([cwd, entry]);
1062
+ const stats = lib_2.fse.statSync(fullPath);
1063
1063
  if (stats.isDirectory()) {
1064
1064
  try {
1065
1065
  // when link
1066
- tnp_core_1.fse.unlinkSync(fullPath);
1066
+ lib_2.fse.unlinkSync(fullPath);
1067
1067
  }
1068
1068
  catch (error) { }
1069
1069
  // Recursively remove directories
@@ -1072,7 +1072,7 @@ ${cwd}
1072
1072
  else {
1073
1073
  // Remove files
1074
1074
  try {
1075
- tnp_core_1.fse.unlinkSync(fullPath);
1075
+ lib_2.fse.unlinkSync(fullPath);
1076
1076
  }
1077
1077
  catch (error) { }
1078
1078
  }
@@ -1090,7 +1090,7 @@ ${cwd}
1090
1090
  createBranchIfNotExists = false;
1091
1091
  }
1092
1092
  try {
1093
- tnp_core_1.child_process.execSync(`git checkout ${createBranchIfNotExists ? '-b' : ''} ${branchName}`, { cwd });
1093
+ lib_2.child_process.execSync(`git checkout ${createBranchIfNotExists ? '-b' : ''} ${branchName}`, { cwd });
1094
1094
  }
1095
1095
  catch (error) {
1096
1096
  index_1.Helpers.error(`Not able to checkout branch: ${branchName}`, false, true);
@@ -1100,30 +1100,30 @@ ${cwd}
1100
1100
  //#region checkout from to
1101
1101
  checkoutFromTo(checkoutFromBranch, targetBranch, origin = 'origin', cwd) {
1102
1102
  index_1.Helpers.log('[checkout] ' + cwd, 1);
1103
- tnp_core_1.child_process.execSync(`git fetch`, { cwd });
1103
+ lib_2.child_process.execSync(`git fetch`, { cwd });
1104
1104
  const currentBranchName = this.currentBranchName(cwd);
1105
1105
  if (currentBranchName === targetBranch) {
1106
1106
  index_1.Helpers.info('Already on proper branch.. just pulling');
1107
- tnp_core_1.child_process.execSync(`git reset --hard`, { cwd });
1108
- tnp_core_1.child_process.execSync(`git pull ${origin} ${checkoutFromBranch}`, {
1107
+ lib_2.child_process.execSync(`git reset --hard`, { cwd });
1108
+ lib_2.child_process.execSync(`git pull ${origin} ${checkoutFromBranch}`, {
1109
1109
  cwd,
1110
1110
  });
1111
1111
  }
1112
1112
  else {
1113
1113
  const targetBranchExists = this.getBranchesNames(cwd).filter(f => targetBranch === f).length > 0;
1114
- tnp_core_1.child_process.execSync(`git reset --hard`, { cwd });
1114
+ lib_2.child_process.execSync(`git reset --hard`, { cwd });
1115
1115
  if (currentBranchName !== checkoutFromBranch) {
1116
- tnp_core_1.child_process.execSync(`git checkout ${checkoutFromBranch}`, { cwd });
1116
+ lib_2.child_process.execSync(`git checkout ${checkoutFromBranch}`, { cwd });
1117
1117
  }
1118
- tnp_core_1.child_process.execSync(`git pull ${origin} ${checkoutFromBranch}`, {
1118
+ lib_2.child_process.execSync(`git pull ${origin} ${checkoutFromBranch}`, {
1119
1119
  cwd,
1120
1120
  });
1121
1121
  if (targetBranchExists) {
1122
- tnp_core_1.child_process.execSync(`git checkout ${targetBranch}`, { cwd });
1123
- tnp_core_1.child_process.execSync(`git rebase ${checkoutFromBranch}`, { cwd });
1122
+ lib_2.child_process.execSync(`git checkout ${targetBranch}`, { cwd });
1123
+ lib_2.child_process.execSync(`git rebase ${checkoutFromBranch}`, { cwd });
1124
1124
  }
1125
1125
  else {
1126
- tnp_core_1.child_process.execSync(`git checkout -b ${targetBranch}`, { cwd });
1126
+ lib_2.child_process.execSync(`git checkout -b ${targetBranch}`, { cwd });
1127
1127
  }
1128
1128
  }
1129
1129
  }
@@ -1179,7 +1179,7 @@ ${cwd}
1179
1179
  * @returns absolute path to cloned folder
1180
1180
  */
1181
1181
  async clone({ cwd, url, destinationFolderName = '', throwErrors, override, }) {
1182
- cwd = (0, tnp_core_1.crossPlatformPath)(cwd);
1182
+ cwd = (0, lib_2.crossPlatformPath)(cwd);
1183
1183
  if (!index_1.Helpers.exists(cwd)) {
1184
1184
  try {
1185
1185
  index_1.Helpers.mkdirp(cwd);
@@ -1216,10 +1216,10 @@ ${cwd}
1216
1216
  if (!url.endsWith('.git')) {
1217
1217
  url = url + '.git';
1218
1218
  }
1219
- const cloneFolderPath = (0, tnp_core_1.crossPlatformPath)(tnp_core_1.path
1219
+ const cloneFolderPath = (0, lib_2.crossPlatformPath)(lib_2.path
1220
1220
  .join(cwd, !!destinationFolderName && destinationFolderName.trim() !== ''
1221
1221
  ? destinationFolderName
1222
- : tnp_core_1.path.basename(url))
1222
+ : lib_2.path.basename(url))
1223
1223
  .trim()
1224
1224
  .replace('.git', ''));
1225
1225
  // console.log({ cloneFolderPath })
@@ -1227,13 +1227,14 @@ ${cwd}
1227
1227
  index_1.Helpers.tryRemoveDir(cloneFolderPath);
1228
1228
  }
1229
1229
  else if (index_1.Helpers.exists(cloneFolderPath) &&
1230
- index_1.Helpers.exists(tnp_core_1.path.join(cloneFolderPath, '.git'))) {
1231
- index_1.Helpers.warn(`[taon-helpers] Already cloned ${tnp_core_1.path.basename(cloneFolderPath)}...`);
1230
+ index_1.Helpers.exists(lib_2.path.join(cloneFolderPath, '.git'))) {
1231
+ index_1.Helpers.warn(`[taon-helpers] Already cloned ${lib_2.path.basename(cloneFolderPath)}...`);
1232
1232
  return cloneFolderPath;
1233
1233
  }
1234
- const commnad = url.startsWith(`https://`) || url.startsWith(`http://`)
1235
- ? `git -c http.sslVerify=false clone ${url} ${tnp_core_1.path.basename(cloneFolderPath)}`
1236
- : `git clone ${url} ${tnp_core_1.path.basename(cloneFolderPath)}`;
1234
+ let isHttpCommand = url.startsWith('http://') || url.startsWith('https://');
1235
+ let commnad = isHttpCommand
1236
+ ? `git -c http.sslVerify=false clone ${url} ${lib_2.path.basename(cloneFolderPath)}`
1237
+ : `git clone ${url} ${lib_2.path.basename(cloneFolderPath)}`;
1237
1238
  index_1.Helpers.info(`
1238
1239
 
1239
1240
  Cloning:
@@ -1245,7 +1246,11 @@ ${cwd}
1245
1246
  }
1246
1247
  else {
1247
1248
  while (true) {
1248
- index_1.Helpers.info(`Cloning from url: ${tnp_core_2.CLI.chalk.bold(url)}..`);
1249
+ isHttpCommand = url.startsWith('http://') || url.startsWith('https://');
1250
+ commnad = isHttpCommand
1251
+ ? `git -c http.sslVerify=false clone ${url} ${lib_2.path.basename(cloneFolderPath)}`
1252
+ : `git clone ${url} ${lib_2.path.basename(cloneFolderPath)}`;
1253
+ index_1.Helpers.info(`Cloning from url: ${lib_3.CLI.chalk.bold(url)}..`);
1249
1254
  try {
1250
1255
  index_1.Helpers.run(commnad, { cwd, output: false }).sync();
1251
1256
  break;
@@ -1255,12 +1260,15 @@ ${cwd}
1255
1260
  index_1.Helpers.error(`[taon-helpers][git] Project not found :${url}`, true, true);
1256
1261
  }
1257
1262
  else {
1258
- index_1.Helpers.error(`[taon-helpers] Can't clone from url: ${tnp_core_2.CLI.chalk.bold(url)}..`, true, true);
1263
+ index_1.Helpers.error(`[taon-helpers] Can't clone from url: ${lib_3.CLI.chalk.bold(url)}..`, true, true);
1259
1264
  }
1260
1265
  const cloneLinkOpt = {
1261
1266
  again: {
1262
1267
  name: 'Try again',
1263
1268
  },
1269
+ againDif: {
1270
+ name: `Try again with ${isHttpCommand ? 'ssh' : 'http'} url`,
1271
+ },
1264
1272
  skip: {
1265
1273
  name: 'Skip cloning this repository',
1266
1274
  },
@@ -1272,6 +1280,12 @@ ${cwd}
1272
1280
  if (res === 'again') {
1273
1281
  continue;
1274
1282
  }
1283
+ if (res === 'againDif') {
1284
+ url = isHttpCommand
1285
+ ? index_1.Helpers.git.originHttpToSsh(url)
1286
+ : index_1.Helpers.git.originSshToHttp(url);
1287
+ continue;
1288
+ }
1275
1289
  if (res === 'exit') {
1276
1290
  process.exit(0);
1277
1291
  }
@@ -1301,7 +1315,7 @@ ${cwd}
1301
1315
  //#region check if there are some uncommited changes except
1302
1316
  thereAreSomeUncommitedChangeExcept(filesList = [], cwd) {
1303
1317
  index_1.Helpers.log('[taon-helpers][thereAreSomeUncommitedChangeExcept] ' + cwd, 1);
1304
- filesList = filesList.map(f => (0, tnp_core_1.crossPlatformPath)(f));
1318
+ filesList = filesList.map(f => (0, lib_2.crossPlatformPath)(f));
1305
1319
  try {
1306
1320
  const res = index_1.Helpers.run(`git ls-files --deleted --modified --others --exclude-standard`, { output: false, cwd })
1307
1321
  .sync()
@@ -1311,7 +1325,7 @@ ${cwd}
1311
1325
  ? []
1312
1326
  : res.split(/\r\n|\n|\r/).filter(f => {
1313
1327
  f = f?.trim();
1314
- return !!f && !filesList.includes((0, tnp_core_1.crossPlatformPath)(f));
1328
+ return !!f && !filesList.includes((0, lib_2.crossPlatformPath)(f));
1315
1329
  });
1316
1330
  return list.length > 0;
1317
1331
  }
@@ -1353,7 +1367,7 @@ ${cwd}
1353
1367
  return;
1354
1368
  }
1355
1369
  try {
1356
- index_1.Helpers.log(`[taon-helpers][git] restoring last verion of file ${tnp_core_1.path.basename(cwd)}/${relativeFilePath}`);
1370
+ index_1.Helpers.log(`[taon-helpers][git] restoring last verion of file ${lib_2.path.basename(cwd)}/${relativeFilePath}`);
1357
1371
  index_1.Helpers.run(`git checkout -- ${relativeFilePath}`, { cwd }).sync();
1358
1372
  }
1359
1373
  catch (error) {
@@ -1369,7 +1383,7 @@ ${cwd}
1369
1383
  index_1.Helpers.run(`git checkout HEAD -- ${p}`, { cwd }).sync();
1370
1384
  }
1371
1385
  catch (err) {
1372
- index_1.Helpers.error(`[taon-helpers][git] Not able to reset files: ${p} inside project ${tnp_core_1.path.basename(cwd)}.`, true, true);
1386
+ index_1.Helpers.error(`[taon-helpers][git] Not able to reset files: ${p} inside project ${lib_2.path.basename(cwd)}.`, true, true);
1373
1387
  }
1374
1388
  });
1375
1389
  }
@@ -1382,14 +1396,14 @@ ${cwd}
1382
1396
  * @returns (absolute pathes to stages files
1383
1397
  */
1384
1398
  stagedFiles(cwd, outputRelatieve = false) {
1385
- cwd = (0, tnp_core_1.crossPlatformPath)(cwd).replace(/\/$/, '');
1399
+ cwd = (0, lib_2.crossPlatformPath)(cwd).replace(/\/$/, '');
1386
1400
  const command = `git diff --name-only --cached`.trim();
1387
1401
  const result = index_1.Helpers.commnadOutputAsString(command, cwd, {}) || '';
1388
1402
  return (result ? result.split('\n') : []).map(relative => {
1389
1403
  if (outputRelatieve) {
1390
- return (0, tnp_core_1.crossPlatformPath)(relative);
1404
+ return (0, lib_2.crossPlatformPath)(relative);
1391
1405
  }
1392
- return (0, tnp_core_1.crossPlatformPath)([cwd, relative]);
1406
+ return (0, lib_2.crossPlatformPath)([cwd, relative]);
1393
1407
  });
1394
1408
  }
1395
1409
  //#endregion
@@ -1404,7 +1418,7 @@ ${cwd}
1404
1418
  originHttpToSsh(originHttp, verbose = false) {
1405
1419
  const httpsPattern = /^https:\/\/(.+?)\/(.+?\/.+?)(\.git)?$/;
1406
1420
  const match = originHttp.match(httpsPattern);
1407
- if (originHttp === 'undefined' || tnp_core_1._.isNil(originHttp)) {
1421
+ if (originHttp === 'undefined' || lib_2._.isNil(originHttp)) {
1408
1422
  index_1.Helpers.error('[taon-helpers][originHttpToSsh] Origin URL is not defined');
1409
1423
  return originHttp;
1410
1424
  }
@@ -1438,7 +1452,7 @@ ${cwd}
1438
1452
  originSshToHttp(originSsh, verbose = false) {
1439
1453
  const sshPattern = /^git@(.+?):(.+?\/.+?)(\.git)?$/;
1440
1454
  const match = originSsh.match(sshPattern);
1441
- if (originSsh === 'undefined' || tnp_core_1._.isNil(originSsh)) {
1455
+ if (originSsh === 'undefined' || lib_2._.isNil(originSsh)) {
1442
1456
  index_1.Helpers.error('[taon-helpers][originSshToHttp] Origin URL is not defined');
1443
1457
  return originSsh;
1444
1458
  }
@@ -1542,13 +1556,13 @@ ${cwd}
1542
1556
  //#region get user info
1543
1557
  async getUserInfo(cwd, global = false) {
1544
1558
  try {
1545
- const name = tnp_core_1.child_process
1559
+ const name = lib_2.child_process
1546
1560
  .execSync(`git config ${global ? '--global' : ''} user.name`, {
1547
1561
  encoding: 'utf-8',
1548
1562
  cwd: cwd || process.cwd(),
1549
1563
  })
1550
1564
  .trim();
1551
- const email = tnp_core_1.child_process
1565
+ const email = lib_2.child_process
1552
1566
  .execSync(`git config ${global ? '--global' : ''} user.email`, {
1553
1567
  encoding: 'utf-8',
1554
1568
  cwd: cwd || process.cwd(),
@@ -1568,12 +1582,12 @@ ${cwd}
1568
1582
  return;
1569
1583
  }
1570
1584
  try {
1571
- tnp_core_1.child_process.execSync(`git config ${global ? '--global' : ''} user.name "${name}"`, { cwd });
1572
- tnp_core_1.child_process.execSync(`git config ${global ? '--global' : ''} user.email "${email}"`, { cwd });
1585
+ lib_2.child_process.execSync(`git config ${global ? '--global' : ''} user.name "${name}"`, { cwd });
1586
+ lib_2.child_process.execSync(`git config ${global ? '--global' : ''} user.email "${email}"`, { cwd });
1573
1587
  }
1574
1588
  catch (error) {
1575
1589
  console.error('Error setting Git user info:', error.message);
1576
- await tnp_core_2.UtilsTerminal.pressAnyKeyToContinueAsync();
1590
+ await lib_3.UtilsTerminal.pressAnyKeyToContinueAsync();
1577
1591
  }
1578
1592
  }
1579
1593
  }