mirror of https://github.com/embarklabs/embark.git
improve url regexes
This commit is contained in:
parent
c1bed28c00
commit
d48c971471
|
@ -24,7 +24,7 @@ class File {
|
||||||
// Only supported in Solidity
|
// Only supported in Solidity
|
||||||
return callback(null, content);
|
return callback(null, content);
|
||||||
}
|
}
|
||||||
const regex = /import ["|']([a-zA-Z0-9_\-.\\\/:]+)";/g;
|
const regex = /import ["|']([-a-zA-Z0-9@:%_+.~#?&\/=]+)["|'];/g;
|
||||||
let matches;
|
let matches;
|
||||||
const filesToDownload = [];
|
const filesToDownload = [];
|
||||||
const pathWithoutFile = path.dirname(self.path);
|
const pathWithoutFile = path.dirname(self.path);
|
||||||
|
|
|
@ -148,7 +148,7 @@ function getExternalContractUrl(file) {
|
||||||
// [4] path
|
// [4] path
|
||||||
// [5] branch
|
// [5] branch
|
||||||
const match = file.match(
|
const match = file.match(
|
||||||
/(git:\/\/)?github\.[a-z]+\/([a-zA-Z0-9_\-.]+)\/([a-zA-Z0-9_\-]+)\/([a-zA-Z0-9_\-\/.]+)#?([a-zA-Z0-1_\-.]*)?/
|
/(git:\/\/)?github\.[a-z]+\/([-a-zA-Z0-9@:%_+.~#?&=]+)\/([-a-zA-Z0-9@:%_+.~#?&=]+)\/([-a-zA-Z0-9@:%_+.~?\/&=]+)#?([a-zA-Z0-1\/_.-]*)?/
|
||||||
);
|
);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
console.error(MALFORMED_ERROR + file);
|
console.error(MALFORMED_ERROR + file);
|
||||||
|
@ -165,7 +165,7 @@ function getExternalContractUrl(file) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const match = url.match(
|
const match = url.match(
|
||||||
/\.[a-z]+\/([a-zA-Z0-9_\-\/.]+)/
|
/\.[a-z]+\/([-a-zA-Z0-9@:%_+.~#?&\/=]+)/
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
url,
|
url,
|
||||||
|
|
Loading…
Reference in New Issue