Properly escape apps.config
This commit is contained in:
@@ -821,9 +821,19 @@ h1, h2, h3, h4, h5, h6 {
|
|||||||
(volume-destroy . ,(search "volume_attachment.machine: Destruction complete" "volume_attachment.machine: Destroying..." "XXX - nothing"))))
|
(volume-destroy . ,(search "volume_attachment.machine: Destruction complete" "volume_attachment.machine: Destroying..." "XXX - nothing"))))
|
||||||
|
|
||||||
(define (write-config-entry name value)
|
(define (write-config-entry name value)
|
||||||
|
(display name)
|
||||||
|
(display "='")
|
||||||
|
(display (if value
|
||||||
|
(string-translate* (->string value) '(("'" . "\\'"))) ;; escape any single quotes
|
||||||
|
""))+
|
||||||
|
(print "'"))
|
||||||
|
|
||||||
|
(define (write-terraform-config-entry name value)
|
||||||
(display name)
|
(display name)
|
||||||
(display "=\"")
|
(display "=\"")
|
||||||
(display value)
|
(display (if value
|
||||||
|
(string-translate* (->string value) '(("\"" . "\\\""))) ;; escape any double quotes
|
||||||
|
""))+
|
||||||
(print "\""))
|
(print "\""))
|
||||||
|
|
||||||
(define (progress-status->text status)
|
(define (progress-status->text status)
|
||||||
@@ -1632,7 +1642,7 @@ chmod -R 777 /opt/keys")))
|
|||||||
(with-output-to-file (string-append dir "/config/production.tfvars")
|
(with-output-to-file (string-append dir "/config/production.tfvars")
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(map (lambda (e)
|
(map (lambda (e)
|
||||||
(write-config-entry (car e) (cdr e)))
|
(write-terraform-config-entry (car e) (cdr e)))
|
||||||
`(("server_type" . ,(alist-ref 'digitalocean-size service-config))
|
`(("server_type" . ,(alist-ref 'digitalocean-size service-config))
|
||||||
("do_token" . ,(alist-ref 'digitalocean-api-token service-config))
|
("do_token" . ,(alist-ref 'digitalocean-api-token service-config))
|
||||||
("digitalocean_volume_size" . ,(alist-ref 'digitalocean-volume-size service-config))
|
("digitalocean_volume_size" . ,(alist-ref 'digitalocean-volume-size service-config))
|
||||||
|
|||||||
Reference in New Issue
Block a user