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.
- package/README.md +7 -7
- package/index.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Install or update
|
|
2
2
|
|
|
3
|
-
`npx
|
|
4
|
-
`npx
|
|
5
|
-
`npx
|
|
6
|
-
`npx
|
|
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
|
|
11
|
-
`npx
|
|
12
|
-
`npx
|
|
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
|
|
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?.
|
|
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
|
-
|
|
159
|
+
installCommand,
|
|
160
160
|
)
|
|
161
161
|
.help()
|
|
162
162
|
.argv;
|