added bin to package.json to make it executable (#32052)

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-08-13 11:29:48 +02:00 committed by GitHub
parent 6b492ca4f2
commit 61726e12c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 3 deletions

View file

@ -1,4 +1,4 @@
=== kc-create # kc-create
Create a new Keycloak ui project based on a template Create a new Keycloak ui project based on a template

View file

@ -10,7 +10,12 @@ import { join, resolve, dirname } from "node:path";
import { simpleGit } from "simple-git"; import { simpleGit } from "simple-git";
import { fileURLToPath } from "url"; import { fileURLToPath } from "url";
const packageJson = JSON.parse(fs.readFileSync("./package.json", "utf8")); const packageJson = JSON.parse(
fs.readFileSync(
join(fileURLToPath(import.meta.url), "..", "package.json"),
"utf8",
),
);
function main() { function main() {
new Command(packageJson.name) new Command(packageJson.name)
@ -72,7 +77,7 @@ async function createProject(name, type) {
const data = Mustache.render(contents, { const data = Mustache.render(contents, {
name, name,
type, type,
version: packageJson.version, version: "^25.0.0",
}); });
await fs.writeFile(destPath, data); await fs.writeFile(destPath, data);
}); });

View file

@ -7,6 +7,9 @@
"scripts": { "scripts": {
"start": "node create.js" "start": "node create.js"
}, },
"bin": {
"create-keycloak-theme": "./create.js"
},
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },