From dfea50a8d68f1f272d2d46c08bed932ecafd384e Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 11 Mar 2022 20:57:04 +0000 Subject: [PATCH] require shebang for linux/mac scripts, refactor middleware/posix --- src/components/scripts/ScriptFormModal.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/scripts/ScriptFormModal.vue b/src/components/scripts/ScriptFormModal.vue index 03db026..3dc0a69 100644 --- a/src/components/scripts/ScriptFormModal.vue +++ b/src/components/scripts/ScriptFormModal.vue @@ -15,6 +15,11 @@ + + Shell/Python + scripts on Linux/Mac need a shebang at the top of the script e.g. #!/bin/bash or + #!/usr/bin/python3
Add one to get rid of this warning. Ignore if windows. +
{ + if (script.value.shell === "shell" || script.value.shell === "python") { + return !script.value.script_body.includes("#!"); + } + }); + const title = computed(() => { if (props.script) { return props.readonly @@ -271,6 +282,7 @@ export default { agent, agentLoading, lang, + missingShebang, // non-reactive data shellOptions,