136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
(targ-path (conc target-dir "/" dest-dir "/" targ-file)))
(if (file-exists? targ-path)
(begin
(print "ERROR: target file already exists, remove it before re-publishing")
(exit 1)))
(if (not(file-exists? dest-dir-path))
(begin
(print "ERROR: target directory " target-dir " does not exists." )
(exit 1)))
(spublish:db-do
configdat
(lambda (db)
(spublish:register-action db "cp" submitter source-path comment)))
(let* (;; (target-path (configf:lookup "settings" "target-path"))
|
|
|
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
(targ-path (conc target-dir "/" dest-dir "/" targ-file)))
(if (file-exists? targ-path)
(begin
(print "ERROR: target file already exists, remove it before re-publishing")
(exit 1)))
(if (not(file-exists? dest-dir-path))
(begin
(print "ERROR: target directory " dest-dir-path " does not exists." )
(exit 1)))
(spublish:db-do
configdat
(lambda (db)
(spublish:register-action db "cp" submitter source-path comment)))
(let* (;; (target-path (configf:lookup "settings" "target-path"))
|
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
|
(begin
(print "ERROR: Missing arguments; " (string-intersperse args ", "))
(exit 1)))
(let* ((targ-link (car args))
(link-name (cadr args))
(sub-path (string-reverse (string-join (cdr (string-split (string-reverse link-name) "/")) "/")))
(msg (or (args:get-arg "-m") "")))
(if(not (equal? sub-path link-name))
(begin
(print "attempting to create directory " sub-path " in " target-dir)
(spublish:validate target-dir sub-path)
(spublish:mkdir configdat user target-dir sub-path msg)))
(print "attempting to create link " link-name " in " target-dir)
(spublish:ln configdat user target-dir targ-link link-name msg)))
((rm)
(if (< (length args) 1)
(begin
|
|
|
|
>
>
>
|
|
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
(begin
(print "ERROR: Missing arguments; " (string-intersperse args ", "))
(exit 1)))
(let* ((targ-link (car args))
(link-name (cadr args))
(sub-path (string-reverse (string-join (cdr (string-split (string-reverse link-name) "/")) "/")))
(msg (or (args:get-arg "-m") "")))
(if (> (string-length(string-trim sub-path)) 0)
(begin
(print "attempting to create directory " sub-path " in " target-dir)
(spublish:validate target-dir sub-path)
(print (conc target-dir "/" sub-path ) )
(print (directory-exists?(conc target-dir "/" sub-path )))
(if (directory-exists?(conc target-dir "/" sub-path ))
(print "Target Directory " (conc target-dir sub-path ) " exist!!")
(spublish:mkdir configdat user target-dir sub-path msg))))
(print "attempting to create link " link-name " in " target-dir)
(spublish:ln configdat user target-dir targ-link link-name msg)))
((rm)
(if (< (length args) 1)
(begin
|