✨ Open project in default browser
This commit is contained in:
+1
-1
@@ -3,4 +3,4 @@
|
||||
'use strict'
|
||||
|
||||
let Keppler = require( './keppler.class.js' ),
|
||||
keppler = new Keppler();
|
||||
keppler = new Keppler()
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"ip": "^1.1.3",
|
||||
"mime": "^1.3.4",
|
||||
"minimatch": "^3.0.3",
|
||||
"opener": "^1.4.2",
|
||||
"pug": "^2.0.0-beta4",
|
||||
"slug": "^0.9.1",
|
||||
"socket.io": "^1.4.6",
|
||||
|
||||
+9
-1
@@ -10,7 +10,8 @@ let express = require( 'express' ),
|
||||
util = require( 'util' ),
|
||||
path = require( 'path' ),
|
||||
Projects = require( './models/projects.class.js' ),
|
||||
fs = require( 'fs' )
|
||||
fs = require( 'fs' ),
|
||||
opener = require( 'opener' )
|
||||
|
||||
/**
|
||||
* Site class
|
||||
@@ -258,6 +259,13 @@ class Site
|
||||
{
|
||||
project = this.projects.create_project( data.name )
|
||||
|
||||
let url = this.options.domain + '/project/' + project.slug
|
||||
|
||||
console.log( 'server'.green.bold + ' - ' + url .cyan )
|
||||
|
||||
// Open in browser
|
||||
opener( url )
|
||||
|
||||
// Debug
|
||||
if( this.options.debug )
|
||||
{
|
||||
|
||||
@@ -96,13 +96,13 @@ class Watcher
|
||||
mime_type = mime.lookup( relative_path ),
|
||||
file = {}
|
||||
|
||||
file.path = relative_path;
|
||||
file.can_read = true;
|
||||
file.path = relative_path
|
||||
file.can_read = true
|
||||
|
||||
// Test mime type
|
||||
if( mime_type.match(/^(audio)|(video)|(image)/) )
|
||||
{
|
||||
file.can_read = false;
|
||||
file.can_read = false
|
||||
}
|
||||
|
||||
// Test exclusion
|
||||
@@ -114,7 +114,7 @@ class Watcher
|
||||
|
||||
// Match excluded path
|
||||
if( minimatch( relative_path, _exclude ) )
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
// Retrieve stats
|
||||
@@ -150,13 +150,13 @@ class Watcher
|
||||
mime_type = mime.lookup( relative_path ),
|
||||
file = {}
|
||||
|
||||
file.path = relative_path;
|
||||
file.can_read = true;
|
||||
file.path = relative_path
|
||||
file.can_read = true
|
||||
|
||||
// Test mime type
|
||||
if( mime_type.match(/^(audio)|(video)|(image)/) )
|
||||
{
|
||||
file.can_read = false;
|
||||
file.can_read = false
|
||||
}
|
||||
|
||||
// Test exclusion
|
||||
@@ -168,7 +168,7 @@ class Watcher
|
||||
|
||||
// Match excluded path
|
||||
if( minimatch( relative_path, _exclude ) )
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
// Retrieve stats
|
||||
|
||||
Reference in New Issue
Block a user