mirror of https://codeberg.org/glenneth/stash.git
Code was not calling the handle-conflict function
This commit is contained in:
parent
42394e1378
commit
c4ec8e5cbe
|
|
@ -121,18 +121,17 @@
|
|||
(else
|
||||
(display (color-message "No valid action selected, no changes made.\n" red-text)))))
|
||||
|
||||
|
||||
(define (create-symlink source target)
|
||||
"Create a symlink for the source directory at the target location."
|
||||
(let ((target-symlink-path (string-append target "/" (basename source))))
|
||||
(if (file-exists? target-symlink-path) ; Checks if the path exists (file, directory, or symlink)
|
||||
(handle-conflicts target-symlink-path source) ; Handle existing path
|
||||
(begin
|
||||
(catch 'system-error
|
||||
(lambda () (symlink source target-symlink-path)
|
||||
(display (color-message (string-append "Symlink created for: " target-symlink-path " -> " source "\n") green-text)))
|
||||
(lambda args
|
||||
(display (color-message "File exists. Unable to create symlink.\n" red-text))))))))
|
||||
(if (file-exists? target-symlink-path)
|
||||
(handle-conflicts target-symlink-path source) ; Call conflict handler if file exists
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(symlink source target-symlink-path)
|
||||
(display (color-message (string-append "Symlink created for: " target-symlink-path " -> " source "\n") green-text)))
|
||||
(lambda args
|
||||
(display (color-message "Error creating symlink.\n" red-text)))))))
|
||||
|
||||
(define (main args)
|
||||
"Main function to parse arguments and initiate processing."
|
||||
|
|
|
|||
Loading…
Reference in New Issue