snow: confirm before uploading packages

Uploading a package is an irreversible operation. It's not even about
accidentally leaking your secret sauce to the internet. You could upload
a package to snow-fort.org by accident and pullute the package name
space [1].

So let's ask the user first before going ahead uploading stuff. We only
ask once even if we're going to upload a dozen packages, so it's not
that annoying. The target repo is also shown in case you want to upload
to a custom repo and want to make sure it does so.

[1] I did (while attempting to uploading to a local snow-fort instance
    during testing). I guess `(chibi snow commands)` is forever mine
    now.
This commit is contained in:
Nguyễn Thái Ngọc Duy 2020-09-04 19:19:36 +07:00
parent 645bf03749
commit 711c89cd97

View file

@ -947,9 +947,11 @@
((package-file? (car o)) ((package-file? (car o))
(if (not (every package-file? (cdr o))) (if (not (every package-file? (cdr o)))
(non-homogeneous)) (non-homogeneous))
(for-each (if (yes-or-no? cfg "Upload " o " to "
(lambda (package) (upload-package cfg spec package)) (remote-uri cfg '(command package uri) "/?"))
o)) (for-each
(lambda (package) (upload-package cfg spec package))
o)))
(else (else
(if (any package-file? (cdr o)) (if (any package-file? (cdr o))
(non-homogeneous)) (non-homogeneous))
@ -958,7 +960,9 @@
(package (create-package (car spec+files) (package (create-package (car spec+files)
(cdr spec+files) (cdr spec+files)
package-file))) package-file)))
(upload-package cfg spec package package-file))))) (if (yes-or-no? cfg "Upload " o " to "
(remote-uri cfg '(command package uri) "/?"))
(upload-package cfg spec package package-file))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Remove - removes the listed libraries. ;; Remove - removes the listed libraries.