Skip to content

Commit 8fff5b9

Browse files
author
Fabian Morón Zirfas
authored
Merge pull request #30 from stefanomasini/master
added #targetengine prefix support Thank you @GitBruno and @stefanomasini
2 parents c8f5a6f + 7454042 commit 8fff5b9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ extendscriptr
1212
.option('-s, --script <path>', 'The input file to compile into an executable extendscript')
1313
.option('-o, --output <path>', 'The path to the wished compiled output file')
1414
.option('-t, --target [targetApp]', 'The Adobe Application the script is intended for. i.e. InDesign [targetApp]')
15+
.option('-e, --targetengine [targetEngine]', 'The target engine. i.e. "session" [targetEngine]')
1516
.parse(process.argv);
1617

1718
console.log('Running extendscriptr with following options:');
@@ -38,6 +39,14 @@ if( adobeTarget &&
3839
browserifyPlugins.push([ prependify, '#target ' + extendscriptr.target + '\n' ]);
3940
};
4041

42+
var targetEngine = String(extendscriptr.targetengine).replace(new RegExp('^[^a-zA-Z_$]|[^0-9a-zA-Z_$]', 'g'), '_');
43+
44+
if (targetEngine !== 'undefined'){
45+
if ( targetEngine.length > 0) {
46+
browserifyPlugins.push([ prependify, '#targetengine "' + targetEngine + '"\n' ]);
47+
}
48+
}
49+
4150
var b = browserify({
4251
entries: [ extendscriptr.script ],
4352
transform: [[require.resolve('babelify'), {

0 commit comments

Comments
 (0)