{"id":16148227,"url":"https://github.com/chanwit/script","last_synced_at":"2025-04-06T21:20:04.416Z","repository":{"id":66507639,"uuid":"266118247","full_name":"chanwit/script","owner":"chanwit","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-29T06:33:41.000Z","size":17,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T03:18:28.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chanwit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-22T13:32:32.000Z","updated_at":"2021-01-29T06:33:43.000Z","dependencies_parsed_at":"2023-02-22T13:31:09.613Z","dependency_job_id":null,"html_url":"https://github.com/chanwit/script","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanwit%2Fscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanwit%2Fscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanwit%2Fscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chanwit%2Fscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chanwit","download_url":"https://codeload.github.com/chanwit/script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247551101,"owners_count":20957051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T00:32:01.105Z","updated_at":"2025-04-06T21:20:04.395Z","avatar_url":"https://github.com/chanwit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# script\n\nA super package to provide syntactic sugars for writing scripts in Golang.\n\n## Use with Gorun\n\n  1. Go get to obtain the `gorun` binary: `go get gorun`\n  1. Create an empty dir and initialize a new go module, `mkdir build`, `cd build`, `go mod init build`\n  1. Inside the `build` dir, call `go get -u github.com/chanwit/script@master` to add it as a dependency\n  1. Create `build.go`, as followed:\n```go\n/// 2\u003e/dev/null ; gorun \"$0\" \"$@\" ; exit $?\n\n// go.mod \u003e\u003e\u003e\n// module build\n// go 1.15\n// require (\n//   github.com/chanwit/script v0.0.0-20210123134408-7360ef9587f5\n// )\n// \u003c\u003c\u003c go.mod\n\npackage main\n\nimport (\n\t. \"github.com/chanwit/script\"\n)\n\nfunc main() {\n\tout := Var()\n\tSystem(\"echo hello\").To(out)\n\tPrintf(\"we are echoing: %s\\n\", out.String())\n\n\tlist := Var()\n\tExec(\"docker\", \"ps\").To(list)\n\tPrint(list.String())\n}\n```\n  then you can `chmod +x build.go` and simply run it with `./build.go`\n\n## Features\n\n- Go Pipe wrapper to provide fluent interface\n- Variable declaration for storing results from sub-processes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanwit%2Fscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchanwit%2Fscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchanwit%2Fscript/lists"}