mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(cloudcmd) add --open: open browser when server started
This commit is contained in:
parent
d2cc38dd50
commit
36dcb9a074
7 changed files with 21 additions and 2 deletions
4
HELP.md
4
HELP.md
|
|
@ -78,9 +78,11 @@ Cloud Commander supports command line parameters:
|
|||
| `--minify` | enable minification
|
||||
| `--progress` | show progress of file operations
|
||||
| `--html-dialogs` | show html dialogs
|
||||
| `--open` | open web browser when server started
|
||||
| `--no-server` | do not start server
|
||||
| `--no-auth` | disable authorization
|
||||
| `--no-online` | load scripts from local server
|
||||
| `--no-open` | do not open web browser when server started
|
||||
| `--no-minify` | disable minification
|
||||
| `--no-progress` | do not show progress of file operations
|
||||
| `--no-html-dialogs` | do not use html dialogs
|
||||
|
|
@ -223,6 +225,7 @@ Here is description of options:
|
|||
"dirStorage" : true, /* store directory listing to localStorage */
|
||||
"minify" : false, /* minification of js,css,html and img */
|
||||
"online" : true, /* load js files from cdn or local path */
|
||||
"open" : false /* open web browser when server started */
|
||||
"cache" : true, /* add cache-control */
|
||||
"showKeysPanel" : true, /* show classic panel with buttons of keys */
|
||||
"port" : 8000, /* http port */
|
||||
|
|
@ -585,3 +588,4 @@ Special Thanks
|
|||
- config template and style;
|
||||
- change order of directories and files;
|
||||
- add ability do not hide path and header when files are scrolling;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
'save',
|
||||
'server',
|
||||
'online',
|
||||
'open',
|
||||
'minify',
|
||||
'progress',
|
||||
'progress-of-copying',
|
||||
|
|
@ -41,6 +42,7 @@
|
|||
port : config('port'),
|
||||
minify : config('minify'),
|
||||
online : config('online'),
|
||||
open : config('open'),
|
||||
editor : config('editor') || 'edward',
|
||||
username : config('username'),
|
||||
root : config('root') || '/',
|
||||
|
|
@ -78,6 +80,7 @@
|
|||
|
||||
config('auth', args.auth);
|
||||
config('online', args.online);
|
||||
config('open', args.open);
|
||||
config('minify', args.minify);
|
||||
config('username', args.username);
|
||||
config('progress', args.progress);
|
||||
|
|
|
|||
|
|
@ -14,9 +14,11 @@
|
|||
"--minify ": "enable minification",
|
||||
"--progress ": "show progress of file operations",
|
||||
"--html-dialogs ": "use html dialogs",
|
||||
"--open ": "open web browser when server started",
|
||||
"--no-server ": "do not start server",
|
||||
"--no-auth ": "disable authorization",
|
||||
"--no-online ": "load scripts from local server",
|
||||
"--no-open ": "do not open web browser when server started",
|
||||
"--no-minify ": "disable minification",
|
||||
"--no-progress ": "do not show progress of file operations",
|
||||
"--no-html-dialogs ": "do not use html dialogs"
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
"dirStorage": false,
|
||||
"minify": false,
|
||||
"online": true,
|
||||
"open": false,
|
||||
"cache": true,
|
||||
"showKeysPanel": true,
|
||||
"port": 8000,
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
DIR_SERVER = DIR_LIB + 'server/',
|
||||
|
||||
http = require('http'),
|
||||
opn = require('opn'),
|
||||
|
||||
cloudcmd = require(DIR_LIB + 'cloudcmd'),
|
||||
exit = require(DIR_SERVER + 'exit'),
|
||||
|
|
@ -61,7 +62,8 @@
|
|||
};
|
||||
|
||||
getPort(function(error, port) {
|
||||
var url = config('ip') || 'localhost' + prefix();
|
||||
var host = config('ip') || 'localhost';
|
||||
var url = 'http://' + host + ':' + port + prefix() + '/';
|
||||
|
||||
if (error)
|
||||
return onError(error);
|
||||
|
|
@ -69,7 +71,10 @@
|
|||
server.listen(port, ip);
|
||||
server.on('error', onError);
|
||||
|
||||
console.log('url: http://%s:%d', url, port);
|
||||
console.log('url:', url);
|
||||
|
||||
if (config('open'))
|
||||
opn(url);
|
||||
});
|
||||
};
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -37,9 +37,11 @@ programs in browser from any computer, mobile or tablet device.
|
|||
--minify enable minification
|
||||
--progress show progress of file operations
|
||||
--html-dialogs use html dialogs
|
||||
--open open web browser when server started
|
||||
--no-auth disable authorization
|
||||
--no-server do not start server
|
||||
--no-online load scripts from local server
|
||||
--no-open do not open web browser when server started
|
||||
--no-minify disable minification
|
||||
--no-progress do not show progress of file operations
|
||||
--no-html-dialogs do not use html dialogs
|
||||
|
|
@ -47,3 +49,4 @@ programs in browser from any computer, mobile or tablet device.
|
|||
.SH RESOURCES AND DOCUMENTATION
|
||||
|
||||
General help using Cloud Commander: <http://cloudcmd.io>
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@
|
|||
"minify": "~2.0.0",
|
||||
"minimist": "~1.2.0",
|
||||
"mollify": "~1.0.0",
|
||||
"opn": "~4.0.1",
|
||||
"os-homedir": "~1.0.0",
|
||||
"package-json": "~2.3.0",
|
||||
"pipe-io": "~1.2.0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue