You've already forked CasaOS
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:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user