ppackage 2.3.0 → 2.3.3
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/bin/askpass +1 -1
- package/index.js +12 -8
- package/package.json +1 -1
package/bin/askpass
CHANGED
package/index.js
CHANGED
|
@@ -163,7 +163,7 @@ class ppackage {
|
|
|
163
163
|
await passthru("git", ["reset", "HEAD", "--", "."]);
|
|
164
164
|
|
|
165
165
|
for(let line of [GITIGNORE_PATH, DOCKERIGNORE_PATH, NPMIGNORE_PATH])
|
|
166
|
-
await passthru("git", ["
|
|
166
|
+
await passthru("git", ["checkout", "--", line]).catch(()=>{});
|
|
167
167
|
|
|
168
168
|
let restore = [];
|
|
169
169
|
if(fs.existsSync(DOCKERIGNORE_PATH)) {
|
|
@@ -177,7 +177,7 @@ class ppackage {
|
|
|
177
177
|
restore = restore.map(v => v.trim()).filter(v => v && v[0] != "#");
|
|
178
178
|
|
|
179
179
|
for(let line of restore)
|
|
180
|
-
await passthru("git", ["
|
|
180
|
+
await passthru("git", ["checkout", "--", line]).catch(()=>{});
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
|
|
@@ -185,13 +185,17 @@ class ppackage {
|
|
|
185
185
|
// yet, this is broader
|
|
186
186
|
|
|
187
187
|
static _git_to_https(repository_url) {
|
|
188
|
-
const SSH_MASK = /^git@/;
|
|
189
|
-
if(!SSH_MASK.test(repository_url))
|
|
190
|
-
return repository_url;
|
|
191
188
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
.replace(SSH_MASK, "https
|
|
189
|
+
const SSH_MASK = new RegExp("^git@([^:]+):(.*)");
|
|
190
|
+
if(SSH_MASK.test(repository_url))
|
|
191
|
+
return repository_url.replace(SSH_MASK, "https://$1/$2");
|
|
192
|
+
|
|
193
|
+
// git+ssh://git@github.com/131/ppackage.git
|
|
194
|
+
const GIT_SSH_MASK = new RegExp("^git\\+ssh://git@([^/]+)/(.*)");
|
|
195
|
+
if(GIT_SSH_MASK.test(repository_url))
|
|
196
|
+
return repository_url.replace(GIT_SSH_MASK, "https://$1/$2");
|
|
197
|
+
|
|
198
|
+
return repository_url;
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
async _find_repo() {
|