Skip to content

Commit dd1d885

Browse files
committed
fix(proxybuilder): fix ed template and package version
1 parent 215d501 commit dd1d885

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/builder.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,15 @@ export class ProxyBuilder {
213213
this.logger.section("Rendering shared configurations");
214214

215215
// Main nginx.conf — the root nginx configuration.
216+
// Keys must match %placeholder% names in the nginx.conf template.
216217
renderTemplate(
217218
"nginx.conf",
218219
{
219-
target: this.target,
220-
ssl_key: path.join(this.target, FOLDERS.ssl, "self-ssl.key"),
221-
ssl_cert: path.join(this.target, FOLDERS.ssl, "self-ssl.crt"),
222-
dhparam: path.join(this.target, "dhparam.pem"),
223-
sites_enabled: path.join(this.target, FOLDERS.sitesEnabled),
224-
modules_enabled: path.join(this.target, FOLDERS.modulesEnabled),
225-
conf_d: path.join(this.target, FOLDERS.confD),
220+
modulesEnabled: path.join(this.target, FOLDERS.modulesEnabled),
221+
logFolder: path.join(this.target, FOLDERS.logs),
222+
dhparamFile: path.join(this.target, "dhparam.pem"),
223+
confDFolder: path.join(this.target, FOLDERS.confD),
224+
sitesEnabled: path.join(this.target, FOLDERS.sitesEnabled),
226225
},
227226
path.join(this.target, FOLDERS.nginx, "nginx.conf"),
228227
this.logger,

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@
99
* @packageDocumentation
1010
*/
1111

12+
import fs from "fs";
1213
import path from "path";
1314
import yargs from "yargs";
1415

16+
// Read the version from package.json at runtime so the CLI banner
17+
// always reflects the installed package version.
18+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf-8"));
19+
1520
yargs
1621
.scriptName("proxybuilder")
22+
.usage(`proxybuilder v${pkg.version}\n\nUsage: $0 <command>`)
1723
.commandDir(path.resolve(path.join(__dirname, "commands")))
1824
.demandCommand(1, "You must specify a command. Run --help for available commands.")
1925
.strict()

0 commit comments

Comments
 (0)