From bae27c4c54c9e1ecca29f29abba8dd02f1cb331c Mon Sep 17 00:00:00 2001 From: Zoe <62722391+juls0730@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:55:12 +0000 Subject: [PATCH] initial commit --- LICENSE | 24 ++++++++++++++++++++++++ go.mod | 3 +++ main.go | 21 +++++++++++++++++++++ zqdgr.config.json | 13 +++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 LICENSE create mode 100644 go.mod create mode 100644 main.go create mode 100644 zqdgr.config.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3c577b0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..2056a5c --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/juls0730/zqdgr-script-example + +go 1.23.4 diff --git a/main.go b/main.go new file mode 100644 index 0000000..0073693 --- /dev/null +++ b/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "log" + "os" +) + +func main() { + if len(os.Args) < 2 { + log.Fatal("Script requires a project path as an argument") + } + projectPath := os.Args[1] + log.Println("Running script for project", projectPath) + file, err := os.Create(projectPath + "/script.sh") + if err != nil { + log.Fatal(err) + } + defer file.Close() + file.WriteString("#!/bin/bash\n") + file.WriteString("echo \"Hello World\"\n") +} diff --git a/zqdgr.config.json b/zqdgr.config.json new file mode 100644 index 0000000..a899363 --- /dev/null +++ b/zqdgr.config.json @@ -0,0 +1,13 @@ +{ + "name": "zqdgr-script-example", + "version": "0.0.1", + "description": "Example script for zqdgr new", + "author": "juls0730", + "license": "Unlicense", + "scripts": { + "build": "go build -o main", + "dev": "go run main.go" + }, + "pattern": "**/*.go", + "excluded_dirs": [] +} \ No newline at end of file