mirror of
https://github.com/luxfi/lpm.git
synced 2026-10-30 16:20:57 +00:00
Lux Partners Limited is the Isle of Man company. Lux Industries Inc, a Delaware C corporation, is the company these sites belong to, so it is the one they name — in metadata, copyright, and the press items that record who signed. The fund site names Lux Assets Management LLC, which is its own company. Two sentences were rewritten rather than renamed, because a name was doing work a name cannot do. One claimed an Isle of Man domicile the naming entity does not have. The other said a company acts on behalf of another; with one entity left it said a company acts on behalf of itself. The Isle of Man stays everywhere it is a JURISDICTION the product supports — the regulatory package, the jurisdiction guides, the compliance tables. Only this company's own identity changed.
55 lines
1.2 KiB
Go
55 lines
1.2 KiB
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package workflow
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
|
|
"github.com/spf13/afero"
|
|
|
|
"github.com/luxfi/lpm/url"
|
|
)
|
|
|
|
type Installer interface {
|
|
Download(url string, path string) error
|
|
Decompress(source string, dest string) error
|
|
// Install installs the VM. installScriptPath is a path relative to
|
|
// workingDir.
|
|
Install(workingDir string, args ...string) error
|
|
}
|
|
|
|
var _ Installer = &VMInstaller{}
|
|
|
|
type VMInstallerConfig struct {
|
|
Fs afero.Fs
|
|
URLClient url.Client
|
|
}
|
|
|
|
func NewVMInstaller(config VMInstallerConfig) *VMInstaller {
|
|
return &VMInstaller{
|
|
fs: config.Fs,
|
|
Client: config.URLClient,
|
|
}
|
|
}
|
|
|
|
type VMInstaller struct {
|
|
fs afero.Fs
|
|
url.Client
|
|
}
|
|
|
|
func (t VMInstaller) Decompress(source string, dest string) error {
|
|
cmd := exec.Command("tar", "xf", source, "-C", dest, "--strip-components", "1")
|
|
return cmd.Run()
|
|
}
|
|
|
|
func (t VMInstaller) Install(workingDir string, args ...string) error {
|
|
cmd := exec.Command(args[0], args[1:]...) // #nosec G204 installation scripts are assumed to be trusted if a user is tracking a plugin repository
|
|
cmd.Stdout = os.Stdout
|
|
cmd.Stderr = os.Stderr
|
|
cmd.Dir = workingDir
|
|
|
|
return cmd.Run()
|
|
}
|