@@ -76,23 +76,30 @@ subroutine get_file(url, tmp_pkg_file, error)
76
76
end
77
77
78
78
! > Perform an http post request with form data.
79
- subroutine upload_form (endpoint , form_data , error )
79
+ subroutine upload_form (endpoint , form_data , verbose , error )
80
+ ! > Endpoint to upload to.
80
81
character (len=* ), intent (in ) :: endpoint
82
+ ! > Form data to upload.
81
83
type (string_t), intent (in ) :: form_data(:)
84
+ ! > Print additional information when true.
85
+ logical , intent (in ) :: verbose
86
+ ! > Error handling.
82
87
type (error_t), allocatable , intent (out ) :: error
83
88
84
89
integer :: stat, i
85
- character (len= :), allocatable :: form_data_str
90
+ character (len= :), allocatable :: form_data_str, cmd
86
91
87
92
form_data_str = ' '
88
93
do i = 1 , size (form_data)
89
94
form_data_str = form_data_str// " -F '" // form_data(i)% s// " ' "
90
95
end do
91
96
97
+ cmd = ' curl -X POST -H "Content-Type: multipart/form-data" ' // form_data_str// endpoint
98
+
92
99
if (which(' curl' ) /= ' ' ) then
93
100
print * , ' Uploading package ...'
94
- call execute_command_line( ' curl -X POST -H "Content-Type: multipart/form-data" ' &
95
- & // form_data_str // endpoint , exitstat= stat)
101
+ if (verbose) print * , ' + ' , cmd
102
+ call execute_command_line(cmd , exitstat= stat)
96
103
else
97
104
call fatal_error(error, " 'curl' not installed." ); return
98
105
end if
@@ -104,8 +111,11 @@ subroutine upload_form(endpoint, form_data, error)
104
111
105
112
! > Unpack a tarball to a destination.
106
113
subroutine unpack (tmp_pkg_file , destination , error )
114
+ ! > Path to tarball.
107
115
character (* ), intent (in ) :: tmp_pkg_file
116
+ ! > Destination to unpack to.
108
117
character (* ), intent (in ) :: destination
118
+ ! > Error handling.
109
119
type (error_t), allocatable , intent (out ) :: error
110
120
111
121
integer :: stat
0 commit comments