Socket
Socket
Sign inDemoInstall

@talend/i18n-scripts

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@talend/i18n-scripts - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

11

index.js

@@ -0,1 +1,2 @@

#!/usr/bin/env node
/* eslint-disable global-require,no-console */

@@ -18,2 +19,10 @@

require(`./scripts/${command}`)(configuration);
const scriptPath = path.join(__dirname, 'scripts', command || '');
if (!fs.existsSync(`${scriptPath}.js`)) {
error(`
The command provided has not been recognized
"${command}" doesn't exist.
`);
}
require(scriptPath)(configuration);

3

package.json
{
"name": "@talend/i18n-scripts",
"description": "Set of scripts to ease i18n workflow",
"version": "0.1.1",
"version": "0.1.2",
"license": "Apache-2.0",

@@ -23,2 +23,3 @@ "main": "index.js",

"cross-spawn": "^6.0.4",
"find": "^0.2.9",
"form-data": "^2.3.3",

@@ -25,0 +26,0 @@ "lodash.template": "^4.4.0",

@@ -7,2 +7,3 @@ const fs = require('fs');

const Zip = require('adm-zip');
const find = require('find');

@@ -13,2 +14,24 @@ const error = require('../common/error');

/**
* List the files under a given path
* @param {String} path
* @returns {Promise}
*/
function listFiles(path) {
return new Promise((resolve, reject) => {
find.file(path, resolve)
});
}
/**
* List the directories under a given path
* @param {String} path
* @returns {Promise}
*/
function listDirs(path) {
return new Promise((resolve, reject) => {
find.dir(path, resolve)
});
}
function extractNpmYarn({ script, method, target }) {

@@ -85,12 +108,8 @@ if (!script || !target) {

function runTransform({ transform, target }) {
async function runTransform({ transform, target }) {
if (transform === 'flatten') {
const filesChild = spawn.sync('find', [target, '-type', 'f']);
if (filesChild.status !== 0) {
error(filesChild.stderr.toString());
}
filesChild.stdout
.toString()
.split('\n')
.filter(filePath => filePath)
const filesChild = await listFiles(target);
filesChild
.forEach(filePath => {

@@ -101,9 +120,4 @@ const fileName = path.basename(filePath);

const directoriesChild = spawn.sync('find', [target, '-type', 'd']);
if (directoriesChild.status !== 0) {
error(directoriesChild.stderr.toString());
}
directoriesChild.stdout
.toString()
.split('\n')
const directoriesChild = await listDirs(target);
directoriesChild
.filter(folderPath => folderPath && folderPath !== target)

@@ -130,3 +144,3 @@ .forEach(folderPath => rimraf.sync(folderPath));

function runExtract({ extract }) {
async function runExtract({ extract }) {
const { method, target } = extract;

@@ -154,3 +168,3 @@ rimraf.sync(target);

runTransform(extract);
await runTransform(extract);
wrapWithVersion(extract);

@@ -157,0 +171,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc