@@ -5,7 +5,8 @@ var program = require('commander')
55program
66 . version ( '0.0.1' )
77 . option ( '-u, --username <username>' , 'Username to which this frame will be linked.' )
8- . option ( '-r, --root <root>' , 'The root domain at which the frame server is accessible.' )
8+ . option ( '-d, --domain <domain>' , 'The root domain (including port) at which the frame server is accessible. Defaults to localhost:8888.' )
9+ . option ( '-c, --chromium' , 'If this flag is present, force the use chromium.' )
910 . parse ( process . argv )
1011
1112if ( ! program . username ) {
@@ -17,7 +18,8 @@ if (!program.username) {
1718}
1819
1920var username = program . username ,
20- root_domain = program . root || "localhost:8888" ;
21+ root_domain = program . domain || "localhost:8888" ,
22+ chromium = program . chromium ;
2123
2224var connect = require ( 'connect' )
2325var http = require ( 'http' )
@@ -52,12 +54,18 @@ http.createServer(app).listen(7000)
5254
5355// if we're on linux, let's try to open the thing with chromium in kiosk mode
5456if ( / ^ l i n u x / . test ( process . platform ) ) {
55- console . log ( 'linux' ) ;
57+ console . log ( 'linux' , process . platform ) ;
5658 exec ( 'xinit /usr/bin/chromium --kiosk http://localhost:7000' , function ( error , stdout , stderr ) {
5759 console . log ( error , stdout , stderr ) ;
5860 } ) ;
5961} else {
60- console . log ( 'not linux' ) ;
61- open ( "http://localhost:7000" ) ;
62+ console . log ( 'not linux' , process . platform ) ;
63+ if ( chromium ) {
64+ exec ( '/Applications/Chromium.app/Contents/MacOS/Chromium --kiosk http://localhost:7000' , function ( error , stdout , stderr ) {
65+ console . log ( error , stdout , stderr ) ;
66+ } ) ;
67+ } else {
68+ open ( "http://localhost:7000" ) ;
69+ }
6270}
6371
0 commit comments