Files
lpm/workflow/remove_repository.go
zeekay 83a37a3684 the IOM entity does not appear on a public surface
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.
2026-08-28 13:16:04 -07:00

59 lines
1.3 KiB
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package workflow
import (
"fmt"
"os"
"path/filepath"
"github.com/luxfi/lpm/constant"
"github.com/luxfi/lpm/state"
)
var _ Workflow = RemoveRepository{}
func NewRemoveRepository(config RemoveRepositoryConfig) *RemoveRepository {
return &RemoveRepository{
sourcesList: config.SourcesList,
repositoriesPath: config.RepositoriesPath,
alias: config.Alias,
}
}
type RemoveRepositoryConfig struct {
SourcesList map[string]*state.SourceInfo
RepositoriesPath string
Alias string
}
type RemoveRepository struct {
sourcesList map[string]*state.SourceInfo
repositoriesPath string
alias string
}
func (r RemoveRepository) Execute() error {
if r.alias == constant.CoreAlias {
fmt.Printf("Can't remove %s (required repository).\n", constant.CoreAlias)
return nil
}
_, ok := r.sourcesList[r.alias]
repoPath := filepath.Join(r.repositoriesPath, r.alias)
if err := os.RemoveAll(repoPath); err != nil {
return err
}
if !ok {
fmt.Printf("%s is already not a tracked repository. Skipping...\n", r.alias)
return nil
}
delete(r.sourcesList, r.alias)
fmt.Printf("Successfully removed %s\n", r.alias)
return nil
}