genomic 5.6.4 → 5.6.6

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.
@@ -1,4 +1,4 @@
1
- import { execSync } from 'child_process';
1
+ import { execFileSync } from 'child_process';
2
2
  import * as fs from 'fs';
3
3
  import { createSpinner } from 'inquirerer';
4
4
  import * as os from 'os';
@@ -75,16 +75,18 @@ export class GitCloner {
75
75
  const depth = options?.depth ?? 1;
76
76
  const singleBranch = options?.singleBranch ?? true;
77
77
  const silent = options?.silent ?? true;
78
- const branchArgs = branch ? ` --branch ${branch}` : '';
79
- const singleBranchArgs = singleBranch ? ' --single-branch' : '';
80
- const depthArgs = ` --depth ${depth}`;
81
- const command = `git clone${branchArgs}${singleBranchArgs}${depthArgs} ${url} ${destination}`;
78
+ const args = ['clone'];
79
+ if (branch)
80
+ args.push('--branch', branch);
81
+ if (singleBranch)
82
+ args.push('--single-branch');
83
+ args.push('--depth', String(depth), '--', url, destination);
82
84
  const spinner = silent ? createSpinner(`Cloning ${url}...`) : null;
83
85
  try {
84
86
  if (spinner) {
85
87
  spinner.start();
86
88
  }
87
- execSync(command, {
89
+ execFileSync('git', args, {
88
90
  stdio: silent ? 'pipe' : 'inherit',
89
91
  encoding: 'utf-8'
90
92
  });
@@ -1,4 +1,4 @@
1
- import { execSync } from 'child_process';
1
+ import { execFileSync } from 'child_process';
2
2
  /**
3
3
  * Check if current package version is outdated compared to npm registry
4
4
  * @param packageName - Package name to check
@@ -7,7 +7,7 @@ import { execSync } from 'child_process';
7
7
  */
8
8
  export async function checkNpmVersion(packageName, currentVersion) {
9
9
  try {
10
- const latestVersion = execSync(`npm view ${packageName} version`, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
10
+ const latestVersion = execFileSync('npm', ['view', packageName, 'version'], { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
11
11
  const isOutdated = compareVersions(currentVersion, latestVersion) < 0;
12
12
  return {
13
13
  currentVersion,
package/git/git-cloner.js CHANGED
@@ -111,16 +111,18 @@ class GitCloner {
111
111
  const depth = options?.depth ?? 1;
112
112
  const singleBranch = options?.singleBranch ?? true;
113
113
  const silent = options?.silent ?? true;
114
- const branchArgs = branch ? ` --branch ${branch}` : '';
115
- const singleBranchArgs = singleBranch ? ' --single-branch' : '';
116
- const depthArgs = ` --depth ${depth}`;
117
- const command = `git clone${branchArgs}${singleBranchArgs}${depthArgs} ${url} ${destination}`;
114
+ const args = ['clone'];
115
+ if (branch)
116
+ args.push('--branch', branch);
117
+ if (singleBranch)
118
+ args.push('--single-branch');
119
+ args.push('--depth', String(depth), '--', url, destination);
118
120
  const spinner = silent ? (0, inquirerer_1.createSpinner)(`Cloning ${url}...`) : null;
119
121
  try {
120
122
  if (spinner) {
121
123
  spinner.start();
122
124
  }
123
- (0, child_process_1.execSync)(command, {
125
+ (0, child_process_1.execFileSync)('git', args, {
124
126
  stdio: silent ? 'pipe' : 'inherit',
125
127
  encoding: 'utf-8'
126
128
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genomic",
3
- "version": "5.6.4",
3
+ "version": "5.6.6",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Clone and customize template repositories with variable replacement",
6
6
  "main": "index.js",
@@ -28,13 +28,13 @@
28
28
  "test:watch": "jest --watch"
29
29
  },
30
30
  "dependencies": {
31
- "appstash": "0.7.1",
32
- "inquirerer": "4.9.3"
31
+ "appstash": "0.8.0",
32
+ "inquirerer": "4.9.4"
33
33
  },
34
34
  "devDependencies": {
35
35
  "copyfiles": "^2.4.1",
36
36
  "makage": "0.1.10"
37
37
  },
38
38
  "keywords": [],
39
- "gitHead": "4a180cf21a2c86ce630eabfc3739d0cd6a608e7a"
39
+ "gitHead": "4499936e61a93af9713b916bb1845b15f42c7aa6"
40
40
  }
@@ -12,7 +12,7 @@ const child_process_1 = require("child_process");
12
12
  */
13
13
  async function checkNpmVersion(packageName, currentVersion) {
14
14
  try {
15
- const latestVersion = (0, child_process_1.execSync)(`npm view ${packageName} version`, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
15
+ const latestVersion = (0, child_process_1.execFileSync)('npm', ['view', packageName, 'version'], { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
16
16
  const isOutdated = compareVersions(currentVersion, latestVersion) < 0;
17
17
  return {
18
18
  currentVersion,