Skip to content

Commit

Permalink
chore: remove deprecated scripts
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Dec 6, 2023
1 parent 61e26c7 commit 10f7049
Show file tree
Hide file tree
Showing 21 changed files with 0 additions and 273 deletions.
64 changes: 0 additions & 64 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,70 +83,6 @@ func InstallKclvm(installRoot string) error {
return nil
}

func InstallKclvmPy(installRoot string) error {
installRoot, err := filepath.Abs(installRoot)
if err != nil {
return err
}
binPath := filepath.Join(installRoot, "bin")

kclvmVersionPath := filepath.Join(binPath, "kclvm.version")

versionMatched, err := checkVersion(kclvmVersionPath)

if err != nil {
return err
}

os.Setenv("PATH", os.Getenv("PATH")+string(os.PathListSeparator)+binPath)

scripts := map[string][]byte{
"kcl": kclScript,
"kclvm": kclvmScript,
"kcl-doc": kclDocScript,
"kcl-fmt": kclFmtScript,
"kcl-lint": kclLintScript,
"kcl-plugin": kclPluginScript,
"kcl-test": kclTestScript,
"kcl-vet": kclVetScript,
}
// Install binaries.
for n, script := range scripts {
err := installBin(binPath, n, script, versionMatched)
if err != nil {
return err
}
}
// Install kclvm libs.
err = installLib(binPath, "kclvm_cli_cdylib", versionMatched)
if err != nil {
return err
}

if !versionMatched {
err = os.WriteFile(kclvmVersionPath, []byte(getVersion()), os.FileMode(os.O_WRONLY|os.O_TRUNC))
if err != nil {
return err
}

}

os.Setenv("PATH", os.Getenv("PATH")+string(os.PathListSeparator)+binPath)
return nil
}

func CleanInstall() {
kclScript = nil
kclvmScript = nil
kclDocScript = nil
kclFmtScript = nil
kclLintScript = nil
kclPluginScript = nil
kclTestScript = nil
kclVetScript = nil
kclvmCliLib = nil
}

func installBin(binDir, binName string, content []byte, versionMatched bool) error {
binPath := findPath(binName)
if binPath == "" || !versionMatched {
Expand Down
32 changes: 0 additions & 32 deletions kclvm_bin_unix.go

This file was deleted.

29 changes: 0 additions & 29 deletions kclvm_bin_windows.go

This file was deleted.

1 change: 0 additions & 1 deletion scripts/dummy.go

This file was deleted.

18 changes: 0 additions & 18 deletions scripts/kcl

This file was deleted.

28 changes: 0 additions & 28 deletions scripts/kcl-doc

This file was deleted.

Binary file removed scripts/kcl-doc.exe
Binary file not shown.
18 changes: 0 additions & 18 deletions scripts/kcl-fmt

This file was deleted.

Binary file removed scripts/kcl-fmt.exe
Binary file not shown.
18 changes: 0 additions & 18 deletions scripts/kcl-lint

This file was deleted.

Binary file removed scripts/kcl-lint.exe
Binary file not shown.
29 changes: 0 additions & 29 deletions scripts/kcl-plugin

This file was deleted.

Binary file removed scripts/kcl-plugin.exe
Binary file not shown.
9 changes: 0 additions & 9 deletions scripts/kcl-test

This file was deleted.

Binary file removed scripts/kcl-test.exe
Binary file not shown.
18 changes: 0 additions & 18 deletions scripts/kcl-vet

This file was deleted.

Binary file removed scripts/kcl-vet.exe
Binary file not shown.
Binary file removed scripts/kcl.exe
Binary file not shown.
9 changes: 0 additions & 9 deletions scripts/kclvm

This file was deleted.

Binary file removed scripts/kclvm-cli.exe
Binary file not shown.
Binary file removed scripts/kclvm.exe
Binary file not shown.

0 comments on commit 10f7049

Please sign in to comment.