Skip to content

Commit

Permalink
refactor(package.js): replace notifications with console logs in fold…
Browse files Browse the repository at this point in the history
…er creation and zipping processes
  • Loading branch information
biati-digital committed Jan 21, 2025
1 parent 35e8ce6 commit e52876c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions development/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const jetpack = require('fs-jetpack');
const path = require('path');
const archiver = require('archiver');
const args = process.argv.slice(2);
const notify = require('./notifications');
const folder = path.join(__dirname, '/..');

/**
Expand Down Expand Up @@ -63,7 +62,7 @@ async function createFolder() {
'!.DS_Store'
]
});
notify('Created folder', `Created folder correctly`);
console.log('Created folder', `Created folder correctly`);

const zip = await createZip(tmpfolder).catch((error) => {
jetpack.remove(tmpfolder);
Expand All @@ -73,7 +72,7 @@ async function createFolder() {
jetpack.remove(tmpfolder);
jetpack.move(zip, path.join(folder, folderName + '-master.zip'));

notify('Done', `Packaging process ended correctly`);
console.log('Done', `Packaging process ended correctly`);
}
createFolder();

Expand All @@ -84,11 +83,11 @@ async function createZip(folder) {
const archive = archiver('zip', { zlib: { level: 9 } });

output.on('close', () => {
notify('Zipped', `zip archive was created correctly`);
console.log('Zipped', `zip archive was created correctly`);
resolve(name);
});
archive.on('error', (err) => {
notify('Package Error', `The was an error creating the zip.`);
console.log('Package Error', `The was an error creating the zip.`);
reject(err);
});

Expand Down

0 comments on commit e52876c

Please sign in to comment.