diff --git a/package.json b/package.json index 58fd589..71df0b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@milaboratory/small-binaries", - "version": "1.6.4", + "version": "1.7.0", "description": "Small cross-platform binaries, like 'sleep' or 'hello-world', suitable for test needs", "scripts": { "cleanup": "rm -rf ./pkg-*.tgz && rm -rf ./build/ && rm -rf ./dist/", @@ -55,6 +55,17 @@ "read-file-to-stdout-with-sleep": { "cmd": [ "{pkg}/main" ] } } } + }, + "runenv-java-stub": { + "environment": { + "registry": { "name": "milaboratories" }, + "name": "common/runenv-java-stub", + "version": "1.0.0", + "type": "java", + "root": "./nonexistent/", + "binDir": ".", + "entrypointName": "runenv-java-stub" + } } } }, diff --git a/runenv-java-stub.go b/runenv-java-stub.go new file mode 100644 index 0000000..d4d3ea0 --- /dev/null +++ b/runenv-java-stub.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "os" + "strings" +) + +func main() { + if len(os.Args) == 1 { + fmt.Fprintf(os.Stdout, "run environment was started with no command and arguments") + } + + cmdToRun := make([]string, 0, len(os.Args)) + for _, arg := range cmdToRun { + cmdToRun = append(cmdToRun, fmt.Sprintf("%q", arg)) + } + + fmt.Fprint(os.Stdout, strings.Join(cmdToRun, " ")) +} diff --git a/scripts/build.sh b/scripts/build.sh index 947c27f..3a2712e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -61,6 +61,7 @@ build_binaries() { rm -rf "${script_dir}/${BUILD_DIR}" +build_binaries "runenv-java-stub" build_binaries "hello-world" build_binaries "guided-command" build_binaries "sleep" diff --git a/scripts/publish.sh b/scripts/publish.sh index c58f1f0..902b0a1 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -36,6 +36,7 @@ publish_packages() { publish_package "${_bin_name}" "macosx" "aarch64" } +publish_binaries "runenv-java-stub" publish_packages "hello-world" publish_packages "guided-command" publish_packages "sleep"