@@ -6,49 +6,49 @@ var prependify = require('prependify');
6
6
var fs = require ( 'fs' ) ;
7
7
8
8
extendscriptr
9
- . version ( packageJson . version )
10
- . usage ( '[options]' )
11
- . option ( '-s, --script <path>' , 'The input file to compile into an executable extendscript' )
12
- . option ( '-o, --output <path>' , 'The path to the wished compiled output file' )
13
- . option ( '-t, --target [targetApp]' , 'The Adobe Application the script is intended for. i.e. InDesign [targetApp]' )
14
- . parse ( process . argv ) ;
9
+ . version ( packageJson . version )
10
+ . usage ( '[options]' )
11
+ . option ( '-s, --script <path>' , 'The input file to compile into an executable extendscript' )
12
+ . option ( '-o, --output <path>' , 'The path to the wished compiled output file' )
13
+ . option ( '-t, --target [targetApp]' , 'The Adobe Application the script is intended for. i.e. InDesign [targetApp]' )
14
+ . parse ( process . argv ) ;
15
15
16
16
console . log ( 'Running extendscriptr with following options:' ) ;
17
17
extendscriptr . options . forEach ( function ( opt ) {
18
- if ( opt . long === '--version' ) return ;
19
- var optionName = opt . long . replace ( '--' , '' ) ;
20
- console . log (
21
- opt . long + ': ' +
22
- extendscriptr [ optionName ] +
23
- ( opt . optional === 0 ? '' : ' (optional)' )
24
- ) ;
18
+ if ( opt . long === '--version' ) return ;
19
+ var optionName = opt . long . replace ( '--' , '' ) ;
20
+ console . log (
21
+ opt . long + ': ' +
22
+ extendscriptr [ optionName ] +
23
+ ( opt . optional === 0 ? '' : ' (optional)' )
24
+ ) ;
25
25
} ) ;
26
26
27
27
var prototypePolyfills = fs . readFileSync ( './node_modules/extendscript.prototypes/lib/extendscript.prototypes.js' , 'utf8' ) ;
28
28
var browserifyPlugins = [ [ prependify , prototypePolyfills ] ] ;
29
29
30
30
var adobeTarget = String ( extendscriptr . target ) . toLowerCase ( ) ;
31
31
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' ] ) ;
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' ] ) ;
37
37
}
38
38
39
39
var b = browserify ( {
40
- entries : [ extendscriptr . script ] ,
41
- transform : [ [ 'babelify' , {
42
- presets : [
43
- 'es2015'
44
- ] ,
45
- plugins : [
46
- 'babel-plugin-transform-es3-member-expression-literals' ,
47
- 'babel-plugin-transform-es3-property-literals' ,
48
- 'babel-plugin-transform-es5-property-mutators'
49
- ]
50
- } ] ] ,
51
- plugin : browserifyPlugins
40
+ entries : [ extendscriptr . script ] ,
41
+ transform : [ [ 'babelify' , {
42
+ presets : [
43
+ 'es2015'
44
+ ] ,
45
+ plugins : [
46
+ 'babel-plugin-transform-es3-member-expression-literals' ,
47
+ 'babel-plugin-transform-es3-property-literals' ,
48
+ 'babel-plugin-transform-es5-property-mutators'
49
+ ]
50
+ } ] ] ,
51
+ plugin : browserifyPlugins
52
52
} ) ;
53
53
54
54
b . bundle ( ) . pipe ( fs . createWriteStream ( extendscriptr . output ) ) ;
0 commit comments