From e3358e06cb64aef5805489a0fba039ae2a9f4ec8 Mon Sep 17 00:00:00 2001 From: Florent Benoit Date: Tue, 16 Nov 2021 14:39:28 +0100 Subject: [PATCH] fix: Make this library executable with npx Fixes https://github.com/eclipse/che/issues/20780 Change-Id: If721ccc4c53f001f28e6522695ab219e71c0ec1b Signed-off-by: Florent Benoit --- tools/devworkspace-handler/package.json | 4 ++++ tools/devworkspace-handler/src/entrypoint.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tools/devworkspace-handler/package.json b/tools/devworkspace-handler/package.json index ac853d340..97fcf18ad 100644 --- a/tools/devworkspace-handler/package.json +++ b/tools/devworkspace-handler/package.json @@ -3,6 +3,8 @@ "version": "0.0.1", "private": false, "description": "Handle management of che-theia-plugins and devWorkspace templates", + "main": "lib/entrypoint.js", + "bin": "lib/entrypoint.js", "publishConfig": { "access": "public" }, @@ -37,11 +39,13 @@ "@devfile/api": "latest", "axios": "0.21.2", "inversify": "^5.0.1", + "fs-extra": "^9.1.0", "js-yaml": "^4.0.0", "jsonc-parser": "^3.0.0", "reflect-metadata": "^0.1.13" }, "devDependencies": { + "@types/fs-extra": "^9.0.11", "rollup": "^2.44.0" }, "jest": { diff --git a/tools/devworkspace-handler/src/entrypoint.ts b/tools/devworkspace-handler/src/entrypoint.ts index 58f4bb8b6..ff3bc373e 100644 --- a/tools/devworkspace-handler/src/entrypoint.ts +++ b/tools/devworkspace-handler/src/entrypoint.ts @@ -1,3 +1,5 @@ +#!/usr/bin/env node +/* eslint-disable header/header */ /********************************************************************** * Copyright (c) 2021 Red Hat, Inc. *