diff options
| author | Runxi Yu <me@runxiyu.org> | 2025-08-12 11:01:07 +0800 |
|---|---|---|
| committer | Runxi Yu <me@runxiyu.org> | 2025-09-26 17:25:37 +0800 |
| commit | e238ccb06b05e88ec323ca95ad4600bd79743372 (patch) | |
| tree | 46f82d4d0f4ec43e94dcde5677de1ba857862638 /forged/internal/misc/deploy.go | |
| parent | Remove forge-specific functions from misc (diff) | |
| download | forge-e238ccb06b05e88ec323ca95ad4600bd79743372.tar.gz forge-e238ccb06b05e88ec323ca95ad4600bd79743372.tar.zst forge-e238ccb06b05e88ec323ca95ad4600bd79743372.zip | |
Refactor
Diffstat (limited to 'forged/internal/misc/deploy.go')
| -rw-r--r-- | forged/internal/misc/deploy.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/forged/internal/misc/deploy.go b/forged/internal/misc/deploy.go deleted file mode 100644 index 3ee5f92..0000000 --- a/forged/internal/misc/deploy.go +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-only -// SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org> - -package misc - -import ( - "io" - "io/fs" - "os" -) - -// DeployBinary copies the contents of a binary file to the target destination path. -// The destination file is created with executable permissions. -func DeployBinary(src fs.File, dst string) (err error) { - var dstFile *os.File - if dstFile, err = os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o755); err != nil { - return err - } - defer dstFile.Close() - _, err = io.Copy(dstFile, src) - return err -} |
