@devcontainer/generator
Advanced tools
Comparing version
@@ -8,2 +8,5 @@ export declare class DevcontainerGenerator { | ||
private _gitVersion; | ||
private _xfce; | ||
private _noVNC; | ||
private _zsh; | ||
constructor(base: string); | ||
@@ -13,4 +16,7 @@ private init; | ||
updateGit(): void; | ||
setXfce(): void; | ||
setNoVNC(): void; | ||
setZsh(): void; | ||
generate(): Promise<string>; | ||
private loadTemplate; | ||
} |
@@ -14,5 +14,8 @@ "use strict"; | ||
this._templates = {}; | ||
this._templateInputs = ['base', 'node', 'git']; | ||
this._templateInputs = ['base', 'node', 'git', 'xfce', 'noVNC', 'zsh']; | ||
this._nodeVesion = ''; | ||
this._gitVersion = ''; | ||
this._xfce = false; | ||
this._noVNC = false; | ||
this._zsh = false; | ||
this.loadTemplate = async (filename) => await fs_1.promises.readFile(`${__dirname}/../../templates/${filename}.Dockerfile`); | ||
@@ -32,2 +35,11 @@ } | ||
} | ||
setXfce() { | ||
this._xfce = true; | ||
} | ||
setNoVNC() { | ||
this._noVNC = true; | ||
} | ||
setZsh() { | ||
this._zsh = true; | ||
} | ||
async generate() { | ||
@@ -37,3 +49,3 @@ const templates = await this.init(); | ||
if (this._gitVersion) { | ||
this._dockerfile += templates['git'].replace('{NODE_VERSION}', this._nodeVesion) | ||
this._dockerfile += templates['git'].replace('{GIT_VERSION}', this._gitVersion) | ||
.replace('{YARN_VERSION}', softwareVersions.yarn); | ||
@@ -45,2 +57,11 @@ } | ||
} | ||
if (this._xfce) { | ||
this._dockerfile += templates['xfce']; | ||
} | ||
if (this._noVNC) { | ||
this._dockerfile += templates['noVNC']; | ||
} | ||
if (this._zsh) { | ||
this._dockerfile += templates['zsh']; | ||
} | ||
return this._dockerfile; | ||
@@ -47,0 +68,0 @@ } |
{ | ||
"name": "@devcontainer/generator", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "generates custorm devcontainer Dockerfiles", | ||
"files": [ | ||
"lib/**/*", | ||
"templates/*" | ||
"templates/*", | ||
"versions.json" | ||
], | ||
@@ -21,3 +22,3 @@ "main": "lib/src/index.js", | ||
"license": "MIT", | ||
"gitHead": "7b70e19dfca8bcfc38274a0000b2686dfa293a4c" | ||
"gitHead": "2d176950049ede7191a35cf1a6ce1e31e666bc75" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
15483
42.2%15
36.36%108
47.95%