Fix home resolution issue

This commit is contained in:
2025-10-17 09:33:43 +02:00
parent 3f0791466b
commit ff76a5399c

View File

@@ -334,8 +334,13 @@ func preprocessInstructions(instructions []LinkInstruction, filename, workdir st
// loadFromReference loads instructions from a referenced file
func loadFromReference(fromFile, currentFile, workdir string, visited map[string]bool) ([]LinkInstruction, error) {
// First convert home directory if it starts with ~
fromPath, err := ConvertHome(fromFile)
if err != nil {
return nil, fmt.Errorf("error converting home directory: %w", err)
}
// Convert relative paths to absolute paths based on the current file's directory
fromPath := fromFile
if !filepath.IsAbs(fromPath) {
currentDir := filepath.Dir(currentFile)
fromPath = filepath.Join(currentDir, fromPath)