mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-11 14:34:40 +00:00
additional warning re: potential version incompatibility
This commit is contained in:
parent
f686fec74a
commit
4812a0d1a2
@ -54,9 +54,10 @@ class TemplateGenerator {
|
|||||||
try {
|
try {
|
||||||
await this.download(url, tmpFilePath, browse);
|
await this.download(url, tmpFilePath, browse);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
let {url_fallback, filePath_fallback, browse_fallback} = ext;
|
let {url_fallback, filePath_fallback, browse_fallback, embarkVersion} = ext;
|
||||||
if (url_fallback) {
|
if (url_fallback) {
|
||||||
console.log(__('Retrying with the master branch...').yellow);
|
console.log(__('Retrying with the master branch...').yellow);
|
||||||
|
console.log((__(`It may not be compatible with your Embark version`) + ` ${embarkVersion}`).yellow);
|
||||||
tmpFilePath = fs.tmpDir(filePath_fallback);
|
tmpFilePath = fs.tmpDir(filePath_fallback);
|
||||||
await this.download(url_fallback, tmpFilePath, browse_fallback);
|
await this.download(url_fallback, tmpFilePath, browse_fallback);
|
||||||
} else {
|
} else {
|
||||||
@ -128,13 +129,13 @@ class TemplateGenerator {
|
|||||||
|
|
||||||
getExternalProject(uri) {
|
getExternalProject(uri) {
|
||||||
let url, folder, hgi;
|
let url, folder, hgi;
|
||||||
let fallback, url_fallback, folder_fallback, hgi_fallback;
|
let fallback, url_fallback, folder_fallback, hgi_fallback, embarkVersion;
|
||||||
hgi = hostedGitInfo.fromUrl(uri);
|
hgi = hostedGitInfo.fromUrl(uri);
|
||||||
if (!hgi || hgi.user.includes('#')) {
|
if (!hgi || hgi.user.includes('#')) {
|
||||||
let templateAndBranch = uri.split('#');
|
let templateAndBranch = uri.split('#');
|
||||||
if (templateAndBranch.length === 1) {
|
if (templateAndBranch.length === 1) {
|
||||||
fallback = true;
|
fallback = true;
|
||||||
let embarkVersion = semver(require('../../package.json').version);
|
embarkVersion = semver(require('../../package.json').version);
|
||||||
templateAndBranch.push(`${embarkVersion.major}.${embarkVersion.minor}`);
|
templateAndBranch.push(`${embarkVersion.major}.${embarkVersion.minor}`);
|
||||||
}
|
}
|
||||||
templateAndBranch[0] = `embark-framework/embark-${templateAndBranch[0]}-template`;
|
templateAndBranch[0] = `embark-framework/embark-${templateAndBranch[0]}-template`;
|
||||||
@ -157,7 +158,8 @@ class TemplateGenerator {
|
|||||||
browse: decodeURIComponent(hgi.browse()),
|
browse: decodeURIComponent(hgi.browse()),
|
||||||
url_fallback,
|
url_fallback,
|
||||||
filePath_fallback: fallback && utils.joinPath(".embark/templates/", folder_fallback, "archive.zip"),
|
filePath_fallback: fallback && utils.joinPath(".embark/templates/", folder_fallback, "archive.zip"),
|
||||||
browse_fallback: fallback && decodeURIComponent(hgi_fallback.browse())
|
browse_fallback: fallback && decodeURIComponent(hgi_fallback.browse()),
|
||||||
|
embarkVersion
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user