antelope-cli 1.0.11 → 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.
package/index.js CHANGED
@@ -1,8 +1,4 @@
1
1
  #!/usr/bin/env node
2
-
3
- const path = require('path');
4
- require('dotenv').config({ path: path.resolve(__dirname, '.env') });
5
-
6
2
  const args = process.argv.slice(2);
7
3
 
8
4
  if (args[0] === "onboarding") {
@@ -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 = '../../src/configs/configs.ts';
4
+ const configsFilePath = 'src/configs/configs.ts';
6
5
 
7
6
  async function start(rl) {
8
7
  try {
9
- const configFile = path.join(__dirname, configsFilePath);
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
@@ -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 = `../../src/assets/img/favicon/${brand.connectedBrandName}`;
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
- const faviconDirectory = path.join(__dirname, faviconDirLocation);
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);
@@ -57,10 +56,9 @@ async function start(rl) {
57
56
  * Returns an object containing the necessary parameters for the RealFaviconGenerator API.
58
57
  */
59
58
  function getFaviconRequest(brand, imagePath) {
60
- console.log(process.env);
61
59
  return {
62
60
  favicon_generation: {
63
- api_key: process.env.FAVICON_API_KEY,
61
+ api_key: '9123c4e1f216b0538089859917ff21b791a4c6db',
64
62
  master_picture: {
65
63
  type: 'url',
66
64
  url: imagePath
@@ -38,8 +38,6 @@ const finishOnboarding = () => {
38
38
  };
39
39
 
40
40
  const startOnBoarding = async () => {
41
- require('dotenv').config();
42
-
43
41
  console.log(chalk.underline(chalk.cyan("Welcome to Antelope's on-boarding bot \n")));
44
42
  try {
45
43
  console.log(chalk.bold(chalk.yellow('\nStep 1: Add to variables-colors.scss')));
@@ -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
- const path = require('path');
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 = path.join(__dirname, `../../src/assets/img/logos/${brand.connectedBrandName}.png`);
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 = `../../src/assets/brands/${brand.connectedBrandName}`;
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(translationsDirectory);
30
+ const folderPath = createTranslationsFolder(translationsDir);
33
31
  createLanguageFiles(languages, folderPath);
34
32
  console.log(chalk.cyan('Translations added successfully!'));
35
33
  resolve(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antelope-cli",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "CLI-Tool for automating processes for Antelope-Systems ",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -21,7 +21,6 @@
21
21
  "homepage": "https://bitbucket.org/xsitesinc/antelope-cli#readme",
22
22
  "dependencies": {
23
23
  "chalk": "^2.0.0",
24
- "dotenv": "^16.4.5",
25
24
  "node-fetch": "^2.6.1",
26
25
  "unzipper": "^0.12.1"
27
26
  }