submodule-version 1.0.0 → 1.0.2

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 (3) hide show
  1. package/README.md +7 -7
  2. package/index.js +4 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Install or update
2
2
 
3
- `npx gmv i repo.git`
4
- `npx gmv i repo.git@1.0.0`
5
- `npx gmv install repo.git@1.0.0`
6
- `npx gmv i repo.git@master`
3
+ `npx sw i repo.git`
4
+ `npx sw i repo.git@1.0.0`
5
+ `npx sw install repo.git@1.0.0`
6
+ `npx sw i repo.git@master`
7
7
 
8
8
  # Validate
9
9
 
10
- `npx gmv`
11
- `npx gmv v`
12
- `npx gmv validate`
10
+ `npx sw`
11
+ `npx sw v`
12
+ `npx sw validate`
package/index.js CHANGED
@@ -99,7 +99,7 @@ const checkoutModule = (url, version) => {
99
99
  const module = isGitUrl(url) ? `${DEFAULT_DIR}/${getName(url)}` : url;
100
100
  logger('checkout', module);
101
101
  try {
102
- execSync(`git -C ${module} checkout ${version}`);
102
+ execSync(`git -C ${module} checkout ${version} -q`);
103
103
  } catch {
104
104
  abort('Checkout failded');
105
105
  };
@@ -110,7 +110,7 @@ const validationCommand = () => {
110
110
  validate(wv, name);
111
111
  };
112
112
 
113
- const makeInstallCommand = arg => {
113
+ const installCommand = arg => {
114
114
  const { url } = arg;
115
115
  const versionMatch = VERSION_REGEX.exec(url) || [];
116
116
  const [, gitaddress = url, version = 'master'] = versionMatch;
@@ -120,7 +120,7 @@ const makeInstallCommand = arg => {
120
120
  }
121
121
 
122
122
  const projectJSON = readProjectJSON();
123
- const installedDep = projectJSON?.wv.dependencies?.[gitaddress];
123
+ const installedDep = projectJSON.wv?.dependencies?.[gitaddress];
124
124
 
125
125
  if (installedDep && installedDep !== version) {
126
126
  checkoutModule(gitaddress, version);
@@ -156,7 +156,7 @@ yargs.scriptName('wv')
156
156
  type: 'string',
157
157
  describe: 'git submodule url',
158
158
  }),
159
- makeInstallCommand,
159
+ installCommand,
160
160
  )
161
161
  .help()
162
162
  .argv;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "submodule-version",
3
3
  "description": "Git submodule versioning tool",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "bin": {
6
6
  "sw": "index.js"
7
7
  },