From e6bb1f0c53c7b75633f94041b08e9efc561ab007 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Fri, 16 Aug 2024 14:57:19 +0200 Subject: [PATCH] Update --- .gitignore | 2 ++ go.mod | 2 +- instruction.go | 7 ++++++- sync | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9c04c96..9a4b270 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ main.exe main_linux +cln.exe +cln diff --git a/go.mod b/go.mod index 4727836..894464a 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module main +module cln go 1.21.7 diff --git a/instruction.go b/instruction.go index 6626932..27dc31e 100644 --- a/instruction.go +++ b/instruction.go @@ -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) } diff --git a/sync b/sync index 7628058..c7ab87d 100644 --- a/sync +++ b/sync @@ -1,2 +1,2 @@ -main.exe,"C:\Program Files\Git\usr\bin\cln.exe",t -main.exe,"~/Seafile/Other/cln.exe",,t \ No newline at end of file +cln.exe,"C:\Program Files\Git\usr\bin\cln.exe",t +cln.exe,"~/Seafile/Other/cln.exe",,t \ No newline at end of file