1
0
mirror of https://github.com/IceWhaleTech/CasaOS.git synced 2025-07-12 23:50:14 +02:00

clean up some unnecessary dependencies, logics, and linter warnings (#963)

Signed-off-by: Tiger Wang <tigerwang@outlook.com>
This commit is contained in:
Tiger Wang
2023-03-18 20:55:51 -04:00
committed by GitHub
parent f530f69ba5
commit 717b47ca2c
15 changed files with 267 additions and 275 deletions

View File

@ -1,19 +1,23 @@
package command
package command_test
import (
"os"
"testing"
"github.com/IceWhaleTech/CasaOS/pkg/utils/command"
"go.uber.org/goleak"
"gotest.tools/assert"
)
func TestExecuteScripts(t *testing.T) {
goleak.VerifyNone(t)
// make a temp directory
tmpDir, err := os.MkdirTemp("", "casaos-test-*")
assert.NilError(t, err)
defer os.RemoveAll(tmpDir)
ExecuteScripts(tmpDir)
command.ExecuteScripts(tmpDir)
// create a sample script under tmpDir
script := tmpDir + "/test.sh"
@ -25,5 +29,5 @@ func TestExecuteScripts(t *testing.T) {
_, err = f.WriteString("#!/bin/bash\necho 123")
assert.NilError(t, err)
ExecuteScripts(tmpDir)
command.ExecuteScripts(tmpDir)
}