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
|
||||
return callback(null, content);
|
||||
}
|
||||
const regex = /import ["|']([a-zA-Z0-9_\-.\\\/:]+)";/g;
|
||||
const regex = /import ["|']([-a-zA-Z0-9@:%_+.~#?&\/=]+)["|'];/g;
|
||||
let matches;
|
||||
const filesToDownload = [];
|
||||
const pathWithoutFile = path.dirname(self.path);
|
||||
|
|
|
@ -148,7 +148,7 @@ function getExternalContractUrl(file) {
|
|||
// [4] path
|
||||
// [5] branch
|
||||
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) {
|
||||
console.error(MALFORMED_ERROR + file);
|
||||
|
@ -165,7 +165,7 @@ function getExternalContractUrl(file) {
|
|||
return null;
|
||||
}
|
||||
const match = url.match(
|
||||
/\.[a-z]+\/([a-zA-Z0-9_\-\/.]+)/
|
||||
/\.[a-z]+\/([-a-zA-Z0-9@:%_+.~#?&\/=]+)/
|
||||
);
|
||||
return {
|
||||
url,
|
||||
|
|
Loading…
Reference in New Issue