{"id":22332744,"url":"https://github.com/xgfone/go-exec","last_synced_at":"2025-03-26T07:22:19.085Z","repository":{"id":57581845,"uuid":"370069612","full_name":"xgfone/go-exec","owner":"xgfone","description":"The common command execution.","archived":false,"fork":false,"pushed_at":"2023-11-02T06:20:38.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T08:43:50.011Z","etag":null,"topics":["command","commander","exec","execute","execution","executor"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xgfone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-05-23T14:08:19.000Z","updated_at":"2022-02-10T14:56:37.000Z","dependencies_parsed_at":"2022-09-26T16:40:28.480Z","dependency_job_id":"3e4e53d6-2e2e-40f8-9887-b21f5980fd9c","html_url":"https://github.com/xgfone/go-exec","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgfone%2Fgo-exec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgfone%2Fgo-exec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgfone%2Fgo-exec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xgfone%2Fgo-exec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xgfone","download_url":"https://codeload.github.com/xgfone/go-exec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245606117,"owners_count":20643110,"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":["command","commander","exec","execute","execution","executor"],"created_at":"2024-12-04T04:19:37.078Z","updated_at":"2025-03-26T07:22:19.056Z","avatar_url":"https://github.com/xgfone.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Command Execution [![Build Status](https://github.com/xgfone/go-exec/actions/workflows/go.yml/badge.svg)](https://github.com/xgfone/go-exec/actions/workflows/go.yml) [![GoDoc](https://pkg.go.dev/badge/github.com/xgfone/go-exec)](https://pkg.go.dev/github.com/xgfone/go-exec) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://raw.githubusercontent.com/xgfone/go-exec/master/LICENSE)\n\nThe package supplies the common command execution supporting `Go1.7+`.\n\n## Install\n```shell\n$ go get -u github.com/xgfone/go-exec\n```\n\n## Example\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/xgfone/go-exec\"\n)\n\nconst scripttmpl = `\nls %s\nrm -rf %s\n`\n\nfunc main() {\n\texec.Execute(context.Background(), \"mkdir\", \"testdir\")\n\texec.ExecuteShellCmd(context.Background(), \"echo abc \u003e %s/%s\", \"testdir\", \"testfile\")\n\n\tdata, _ := exec.OutputShellCmd(context.Background(), \"cat %s/%s\", \"testdir\", \"testfile\")\n\tfmt.Println(data)\n\n\t_, _, err := exec.RunShellScript(context.Background(), scripttmpl, \"testdir\", \"testdir\")\n\tfmt.Println(err)\n\n\t// Output:\n\t// abc\n\t//\n\t// \u003cnil\u003e\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxgfone%2Fgo-exec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxgfone%2Fgo-exec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxgfone%2Fgo-exec/lists"}