antelope-cli 1.0.12 → 1.0.13
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.
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
2
|
const brandModule = require('./brand.js');
|
|
4
3
|
const chalk = require('chalk');
|
|
5
|
-
const configsFilePath = '
|
|
4
|
+
const configsFilePath = 'src/configs/configs.ts';
|
|
6
5
|
|
|
7
6
|
async function start(rl) {
|
|
8
7
|
try {
|
|
9
|
-
const configFile =
|
|
8
|
+
const configFile = configsFilePath;
|
|
10
9
|
// Get User FCMSenderId and type
|
|
11
10
|
let { FCMSenderId, type } = await promptForValues(rl);
|
|
12
11
|
// Making sure the type is all caps
|
package/onboarding/favicon.js
CHANGED
|
@@ -8,7 +8,7 @@ const unzipper = require('unzipper');
|
|
|
8
8
|
async function start(rl) {
|
|
9
9
|
try {
|
|
10
10
|
const brand = brandModule.getBrand();
|
|
11
|
-
const faviconDirLocation =
|
|
11
|
+
const faviconDirLocation = `src/assets/img/favicon/${brand.connectedBrandName}`;
|
|
12
12
|
|
|
13
13
|
// Prompt user for the URL of the logo image
|
|
14
14
|
const imagePath = await promptUser('Please provide the url to your favicon image: ', rl);
|
|
@@ -31,8 +31,7 @@ async function start(rl) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// Download and extract the zip file to the favicon directory
|
|
34
|
-
|
|
35
|
-
await fs.promises.mkdir(faviconDirectory, { recursive: true });
|
|
34
|
+
await fs.promises.mkdir(faviconDirLocation, { recursive: true });
|
|
36
35
|
|
|
37
36
|
const zipUrl = json.favicon_generation_result.favicon.package_url;
|
|
38
37
|
const zipResponse = await fetch(zipUrl);
|
package/onboarding/logo.js
CHANGED
|
@@ -2,7 +2,7 @@ const chalk = require('chalk');
|
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const https = require('https');
|
|
4
4
|
const brandModule = require('./brand.js');
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
|
|
7
7
|
const downloadLogo = (url, dest) => {
|
|
8
8
|
const file = fs.createWriteStream(dest);
|
|
@@ -23,7 +23,7 @@ const downloadLogo = (url, dest) => {
|
|
|
23
23
|
function start(rl) {
|
|
24
24
|
const brand = brandModule.getBrand();
|
|
25
25
|
return new Promise((resolve, reject) => {
|
|
26
|
-
const logoDirLocation =
|
|
26
|
+
const logoDirLocation = `src/assets/img/logos/${brand.connectedBrandName}.png`;
|
|
27
27
|
rl.question('Please enter the URL to the logo image suitable for a black background:\n', async (url) => {
|
|
28
28
|
try {
|
|
29
29
|
console.log(chalk.inverse('Downloading logo...'));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
2
|
const chalk = require('chalk');
|
|
4
3
|
const brandModule = require('./brand.js');
|
|
5
|
-
|
|
4
|
+
const path = require('path');
|
|
6
5
|
function createTranslationsFolder(translationsDirectory) {
|
|
7
6
|
const folderPath = path.join(translationsDirectory, 'languages');
|
|
8
7
|
|
|
@@ -22,14 +21,13 @@ function createLanguageFiles(languages, folderPath) {
|
|
|
22
21
|
|
|
23
22
|
function start(rl) {
|
|
24
23
|
const brand = brandModule.getBrand();
|
|
25
|
-
const translationsDir =
|
|
26
|
-
const translationsDirectory = path.join(__dirname, translationsDir);
|
|
24
|
+
const translationsDir = `src/assets/brands/${brand.connectedBrandName}`;
|
|
27
25
|
return new Promise((resolve, reject) => {
|
|
28
26
|
try {
|
|
29
27
|
rl.question('Enter the languages (2-letter codes) separated by commas:\n', (languagesInput) => {
|
|
30
28
|
const languages = languagesInput.trim().split(',');
|
|
31
29
|
brandModule.updateBrand({ languages });
|
|
32
|
-
const folderPath = createTranslationsFolder(
|
|
30
|
+
const folderPath = createTranslationsFolder(translationsDir);
|
|
33
31
|
createLanguageFiles(languages, folderPath);
|
|
34
32
|
console.log(chalk.cyan('Translations added successfully!'));
|
|
35
33
|
resolve(null);
|