Skip to content

Commit

Permalink
fix: call method to extend MultipartFile
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Aug 11, 2024
1 parent 04854bf commit be96735
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
37 changes: 19 additions & 18 deletions configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,25 @@ export async function configure(command: ConfigureCommand) {
return
}

/**
* Create a flat collection of dependencies to install
* based upon the configured services.
*/
const pkgsToInstall = services
.flatMap((service) => STORAGE_SERVICES[service].dependencies)
.map((pkg) => {
return { name: pkg, isDevDependency: false }
})

/**
* Prompt to install additional services
*/
if (!shouldInstallPackages && pkgsToInstall.length) {
shouldInstallPackages = await command.prompt.confirm(
'Do you want to install additional packages required by "@adonisjs/drive"?'
)
}

const codemods = await command.createCodemods()

/**
Expand Down Expand Up @@ -172,28 +191,10 @@ export async function configure(command: ConfigureCommand) {
),
})

/**
* Create a flat collection of dependencies to install
* based upon the configured services.
*/
const pkgsToInstall = services
.flatMap((service) => STORAGE_SERVICES[service].dependencies)
.map((pkg) => {
return { name: pkg, isDevDependency: false }
})
if (!pkgsToInstall.length) {
return
}

/**
* Prompt to install additional services
*/
if (!shouldInstallPackages) {
shouldInstallPackages = await command.prompt.confirm(
'Do you want to install additional packages required by "@adonisjs/drive"?'
)
}

if (shouldInstallPackages) {
await codemods.installPackages(pkgsToInstall)
} else {
Expand Down
1 change: 1 addition & 0 deletions providers/drive_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,6 @@ export default class DriveProvider {
})

await this.registerViewHelpers(drive)
await this.extendMultipartFile(drive)
}
}

0 comments on commit be96735

Please sign in to comment.