(url, filename)
| 186 | } |
| 187 | |
| 188 | async function check(url, filename) { |
| 189 | const pathname = Url.join(url, filename); |
| 190 | |
| 191 | const fs = fsOperation(pathname); |
| 192 | if (!(await fs.exists())) return filename; |
| 193 | |
| 194 | const action = await select(strings["file already exists"], [ |
| 195 | ["overwrite", strings.overwrite], |
| 196 | ["newname", strings["enter file name"]], |
| 197 | ]); |
| 198 | |
| 199 | if (action === "newname") { |
| 200 | filename = await getfilename(url, filename); |
| 201 | } |
| 202 | |
| 203 | return filename; |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | export default saveFile; |
no test coverage detected