Skip to content

Commit af65ed0

Browse files
author
Bruno Herfst
committed
Revert to c6fddf8
1 parent 4824d3c commit af65ed0

1 file changed

Lines changed: 24 additions & 31 deletions

File tree

index.js

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ 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('-ts, --typescript', 'typescript mode')
1615
.parse(process.argv);
1716

1817
console.log('Running extendscriptr with following options:');
1918
extendscriptr.options.forEach(function(opt) {
20-
if (opt.long === '--version') return;
19+
if (opt.long === '--version') return;
2120
var optionName = opt.long.replace('--', '');
2221
console.log(
2322
opt.long + ': ' +
@@ -26,37 +25,31 @@ extendscriptr.options.forEach(function(opt) {
2625
);
2726
});
2827

29-
var browserifyPlugins = [];
28+
var prototypePolyfills = fs.readFileSync(require.resolve('extendscript.prototypes'), 'utf8');
29+
var browserifyPlugins = [ [ prependify, prototypePolyfills ] ];
30+
3031
var adobeTarget = String(extendscriptr.target).toLowerCase();
3132
if ( adobeTarget &&
32-
( adobeTarget.indexOf('indesign') >= 0 ||
33-
adobeTarget.indexOf('photoshop') >= 0 ||
34-
adobeTarget.indexOf('illustrator') >= 0 ||
35-
adobeTarget.indexOf('aftereffects') >= 0 )) {
36-
browserifyPlugins.push([ prependify, '#target ' + extendscriptr.target + '\n' ]);
33+
(adobeTarget.indexOf('indesign') >= 0 ||
34+
adobeTarget.indexOf('photoshop') >= 0 ||
35+
adobeTarget.indexOf('illustrator') >= 0 ||
36+
adobeTarget.indexOf('aftereffects') >= 0)) {
37+
browserifyPlugins.push([ prependify, '#target ' + extendscriptr.target + '\n' ]);
3738
}
3839

39-
if( extendscriptr.typescript ) {
40-
console.log('Typescript mode is currently under development.');
41-
return;
42-
} else {
43-
var prototypePolyfills = fs.readFileSync(require.resolve('extendscript.prototypes'), 'utf8');
44-
browserifyPlugins.push ([ prependify, prototypePolyfills ]);
45-
46-
var b = browserify({
47-
entries: [ extendscriptr.script ],
48-
transform: [['babelify', {
49-
presets: [
50-
'es2015'
51-
],
52-
plugins: [
53-
'babel-plugin-transform-es3-member-expression-literals',
54-
'babel-plugin-transform-es3-property-literals',
55-
'babel-plugin-transform-es5-property-mutators'
56-
]
57-
}]],
58-
plugin: browserifyPlugins
59-
});
40+
var b = browserify({
41+
entries: [ extendscriptr.script ],
42+
transform: [['babelify', {
43+
presets: [
44+
'es2015'
45+
],
46+
plugins: [
47+
'babel-plugin-transform-es3-member-expression-literals',
48+
'babel-plugin-transform-es3-property-literals',
49+
'babel-plugin-transform-es5-property-mutators'
50+
]
51+
}]],
52+
plugin: browserifyPlugins
53+
});
6054

61-
b.bundle().pipe(fs.createWriteStream(extendscriptr.output));
62-
}
55+
b.bundle().pipe(fs.createWriteStream(extendscriptr.output));

0 commit comments

Comments
 (0)