File tree Expand file tree Collapse file tree 3 files changed +34
-5
lines changed Expand file tree Collapse file tree 3 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,30 @@ const storage = new Storage();
10
10
const bucket = storage . bucket ( 'installer-to.appspot.com' ) ;
11
11
12
12
app . get ( '/' , ( req , res ) => {
13
- res . json ( { status : 'OK' } ) ;
13
+ res . set ( 'Content-Type' , 'application/json' ) ;
14
+ res . json ( { status : 'OK' } ) ;
15
+ } ) ;
16
+
17
+ app . get ( '/health' , ( req , res ) => {
18
+ res . set ( 'Content-Type' , 'application/json' ) ;
19
+ res . json ( { status : 'OK' } ) ;
14
20
} ) ;
15
21
16
22
app . get ( '/:package' , ( req , res ) => {
17
23
try {
18
- const file = bucket . file ( req . params . package + '/installer.sh' ) ;
24
+ const minParam = req . query . min ;
25
+ const withParam = req . query . with ;
26
+ const fileName = [ 'installer' ] ;
27
+
28
+ if ( minParam ) {
29
+ fileName . push ( 'min' ) ;
30
+ }
31
+ if ( withParam ) {
32
+ fileName . push ( withParam ) ;
33
+ }
34
+ fileName . push ( 'sh' ) ;
35
+ const fileNameString = fileName . join ( "." ) ;
36
+ const file = bucket . file ( req . params . package + '/' + fileNameString ) ;
19
37
res . set ( 'Content-Type' , 'text/plain' ) ;
20
38
const readStream = file . createReadStream ( ) ;
21
39
readStream . pipe ( res ) ;
Original file line number Diff line number Diff line change @@ -151,6 +151,8 @@ def generate_individual_installers(method, lines):
151
151
installer_sh_path = path + "/installer." + method + ".sh"
152
152
try :
153
153
with open (installer_sh_path , "w" ) as installer_sh :
154
+ installer_sh .write ("""#!/bin/sh
155
+ """ )
154
156
write_sudo_fix_commands (installer_sh )
155
157
write_logger_commands (installer_sh )
156
158
write_installer_commands (installer_sh , lines )
Original file line number Diff line number Diff line change 8
8
9
9
CHANGED=$( echo $X | tr ' ' ' \n' | sort | uniq | xargs)
10
10
11
- echo " minifying $CHANGED "
11
+ echo " Minifying $CHANGED "
12
12
# shellspec $CHANGED
13
13
14
- for word in $CHANGED ; do
15
- ./minifier.sh -f=" $word /installer.sh" > " $word /installer.min.sh"
14
+ for directory in $CHANGED ; do
15
+ echo " Minifying direcory is: $directory "
16
+ for file in $directory /installer* .sh; do
17
+ case " $file " in
18
+ (* .min.sh) continue ;;
19
+ esac
20
+ filename=${file##*/ }
21
+ filename=${filename% .sh}
22
+ echo " Minifying $directory /$filename .sh"
23
+ ./minifier.sh -f=" $directory /$filename .sh" > " $directory /$filename .min.sh"
24
+ done
16
25
done
You can’t perform that action at this time.
0 commit comments