(mount: Mount | string)
| 278 | * @returns mount command string |
| 279 | */ |
| 280 | export function generateMountCommand(mount: Mount | string): string[] { |
| 281 | const command: string = '--mount'; |
| 282 | |
| 283 | if (typeof mount === 'string') { |
| 284 | return [command, mount]; |
| 285 | } |
| 286 | |
| 287 | const type: string = `type=${mount.type},`; |
| 288 | const source: string = mount.source ? `src=${mount.source},` : ''; |
| 289 | const destination: string = `dst=${mount.target}`; |
| 290 | |
| 291 | const args: string = `${type}${source}${destination}`; |
| 292 | |
| 293 | return [command, args]; |
| 294 | } |