Skip to content

Commit

Permalink
Merge pull request #111 from shoutem/release/0.13.13
Browse files Browse the repository at this point in the history
Release/0.13.13
  • Loading branch information
Definitely-Not-Vlad authored Mar 8, 2021
2 parents ec0e185 + 0366d81 commit 71a0532
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shoutem/cli",
"version": "0.13.12",
"version": "0.13.13",
"description": "Command-line tools for Shoutem applications",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions src/cli/page/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export async function createPage(opts, extensionPath) {
const changes = await instantiateExtensionTemplate('settings-page', { ...opts, extensionPath, developer });
await offerChanges(changes);
console.log('Success'.green.bold);
console.log('Remember to create \'server/translations/en.json\' and add your translation strings to it.\nYou can use \'server/translations/example.json\' to check the format.');
}
27 changes: 19 additions & 8 deletions src/commands/clone.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Promise from 'bluebird';
import _ from 'lodash';
import mkdirp from 'mkdirp-promise';
import tmp from 'tmp-promise';
import rmrf from 'rmfr';
Expand Down Expand Up @@ -35,14 +36,24 @@ export async function pullExtensions(appId, destinationDir) {
}

async function pullExtension(destinationDir, { extension, canonicalName }) {
try {
const url = await getExtensionUrl(extension);
const tgzDir = (await tmp.dir()).path;
await downloadFile(url, { directory: tgzDir, filename: 'extension.tgz' });
await shoutemUnpack(path.join(tgzDir, 'extension.tgz'), path.join(destinationDir, canonicalName));
} catch (err) {
err.message = `Could not fetch extension ${canonicalName}.`;
throw err;
let pullError = {};
let pullSuccessful = false;
for (let i = 0; !pullSuccessful || i < 4; i++) {
try {
const url = await getExtensionUrl(extension);
const tgzDir = (await tmp.dir()).path;
await downloadFile(url, { directory: tgzDir, filename: 'extension.tgz' });
await shoutemUnpack(path.join(tgzDir, 'extension.tgz'), path.join(destinationDir, canonicalName));
pullSuccessful = true;
} catch (error) {
pullError = error;
console.log(`Failed to download extension ${canonicalName}, try ${i + 1}/5`);
}
}

if (!pullSuccessful) {
pullError.message = `Could not fetch extension ${canonicalName}.`;
throw pullError;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"{{developer.name}}": {
"{{extJson.name}}": {
"extension-page.save-button": "Save",
"extension-page.enter-company-name": "Enter company name",
"extension-page.company": "Company:",
"shortcut-page.save-button": "Save",
"shortcut-page.choose-your-greeting": "Choose your greeting",
"shortcut-page.name": "Name:"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"{{developer.name}}": {
"{{extJson.name}}": {
"extension-page.save-button": "Save",
"extension-page.enter-company-name": "Enter company name",
"extension-page.company": "Company:",
"shortcut-page.save-button": "Save",
"shortcut-page.choose-your-greeting": "Choose your greeting",
"shortcut-page.name": "Name:"
}
}
}

0 comments on commit 71a0532

Please sign in to comment.