-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 58139a0
Showing
12 changed files
with
710 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# node | ||
node_modules | ||
npm-debug*.log | ||
|
||
# this project | ||
config/* | ||
!config/default-0.json5 | ||
|
||
# system | ||
tmux-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
class Port { | ||
constructor(port, project) { | ||
this._port = port; | ||
this._project = project; | ||
} | ||
|
||
free() { | ||
this._project = void 0; | ||
} | ||
|
||
set project(project) { | ||
this._project = project; | ||
} | ||
|
||
get project() { | ||
return this._project; | ||
} | ||
|
||
get isFree() { | ||
return !this._project; | ||
} | ||
|
||
get number() { | ||
return this._port; | ||
} | ||
|
||
set project(project) { | ||
// two way assign | ||
if(!project.port) { | ||
this.project = project; | ||
project.port = this; | ||
} else | ||
console.log('Ths project is running on port ' + project.port.number); | ||
} | ||
} | ||
|
||
module.exports = Port; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
class Project { | ||
constructor(options) { | ||
this._name = options.name; | ||
this._path = options.path; | ||
this._port = options.port; | ||
this._c9 = options.c9; | ||
this._active = false; | ||
} | ||
|
||
killC9() { | ||
const c9 = this._c9; | ||
if (c9 && c9.pid && !c9.killed) { | ||
try { | ||
process.kill(c9.pid); | ||
} catch(err) { | ||
return false; | ||
} | ||
this._port.free(); | ||
this._port = void 0; | ||
return true; | ||
} else | ||
return false; | ||
} | ||
|
||
get isActive() { | ||
return !!this._port; | ||
} | ||
|
||
get name() { | ||
return this._name; | ||
} | ||
|
||
set path(path) { | ||
this._path = path; | ||
} | ||
|
||
get path() { | ||
return this._path; | ||
} | ||
|
||
set port(port) { | ||
// two way assign | ||
if(port.isFree) { | ||
this._port = port; | ||
port.project = this; | ||
} else | ||
console.log('Ths port is not free. Used by project' + port.project.name); | ||
} | ||
|
||
get port() { | ||
return this._port; | ||
} | ||
|
||
get isActive() { | ||
return !!this._port; | ||
} | ||
|
||
set c9(c9) { | ||
this._c9 = c9; | ||
} | ||
|
||
get c9() { | ||
return this._c9; | ||
} | ||
} | ||
|
||
module.exports = Project; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### Cloud9 Launcher | ||
|
||
It's a Nodejs application allows you manage your Cloud9 IDE workflows on your own server without the need of a terminal. | ||
|
||
### Install | ||
|
||
#### Cloud9 IDE | ||
|
||
reference [c9/core](https://github.com/c9/core) | ||
|
||
#### Cloud9 Launcher | ||
|
||
```sh | ||
git clone https://github.com/ALiangLiang/cloud9-launcher.git | ||
cd cloud9-launcher | ||
cp config/default-0.json5 config/local-0.json5 | ||
vim config/local-0.json5 # fill this configure file | ||
npm start | ||
``` |
Oops, something went wrong.