diff --git a/package.json b/package.json index 9243411..bade4b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ssync", - "version": "0.0.18", + "version": "0.0.19", "description": "Sync a NetSuite environment with a local repository.", "main": "./dist/app.js", "scripts": { diff --git a/src/helpers/sdf.ts b/src/helpers/sdf.ts index e7a45a7..650d92c 100644 --- a/src/helpers/sdf.ts +++ b/src/helpers/sdf.ts @@ -114,29 +114,30 @@ const importObjectsSlowly = async () => { CustomObjects.forEach(async (custObject: CustomObject) => { if (ephermeralCustomizations.includes(custObject.type)) return; if (custObject.objects[0] === undefined) return; - if (!slowlyImportCustomizations.includes(custObject.type)) return; - console.log(`Attempting to import slow ${custObject.type} ...`) - - // List all objects - custObject.objects = (await runCommand(CLICommand.ListObjects, `--type ${custObject.type}`)) - .stdout - .replace(`\x1B[2K\x1B[1G`, ``) - .split('\n') - .filter(entry => entry.startsWith(custObject.type)) - .map(x => x.split(":")[1]); - - // Import all collected objects - const collectOutput = await runCommand(CLICommand.ImportObjects, - `--scriptid ${custObject.objects.join(" ")} ` + - `--type ${custObject.type} ` + - `--destinationfolder ${custObject.destination} ` + - `--excludefiles` - ); - - if (collectOutput.includes(`The following objects failed with reason "Import custom objects failed.":`)) { - custObject.error = true; - console.error(`Failed to import: ${custObject.type}`); - }; + if (slowlyImportCustomizations.includes(custObject.type)) { + console.log(`Attempting to import slow ${custObject.type} ...`) + + // List all objects + custObject.objects = (await runCommand(CLICommand.ListObjects, `--type ${custObject.type}`)) + .stdout + .replace(`\x1B[2K\x1B[1G`, ``) + .split('\n') + .filter(entry => entry.startsWith(custObject.type)) + .map(x => x.split(":")[1]); + + // Import all collected objects + const collectOutput = await runCommand(CLICommand.ImportObjects, + `--scriptid ${custObject.objects.join(" ")} ` + + `--type ${custObject.type} ` + + `--destinationfolder ${custObject.destination} ` + + `--excludefiles` + ); + + if (collectOutput.includes(`The following objects failed with reason "Import custom objects failed.":`)) { + custObject.error = true; + console.error(`Failed to import: ${custObject.type}`); + }; + } }); CustomObjects.forEach(custObject => {