This commit is contained in:
2024-08-16 14:57:19 +02:00
parent e149103d21
commit e6bb1f0c53
4 changed files with 11 additions and 4 deletions

View File

@@ -82,7 +82,12 @@ func (instruction *LinkInstruction) RunSync() error {
}
}
err := os.Symlink(instruction.Source, instruction.Target)
var err error
if instruction.Hard {
err = os.Link(instruction.Source, instruction.Target)
} else {
err = os.Symlink(instruction.Source, instruction.Target)
}
if err != nil {
return fmt.Errorf("failed creating symlink between %s%s%s and %s%s%s with error %s%+v%s", SourceColor, instruction.Source, DefaultColor, TargetColor, instruction.Target, DefaultColor, ErrorColor, err, DefaultColor)
}