Skip to content

Commit

Permalink
fix: cloud service import() on case-sensitive filesystems (#1174)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHoste authored Dec 7, 2021
1 parent 987b5c4 commit 5feb120
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/cli/src/lingui-extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ export default async function command(

// If service key is present in configuration, synchronize with cloud translation platform
if (typeof config.service === 'object' && config.service.name && config.service.name.length) {
import(`./services/${config.service.name}`)
const moduleName = config.service.name.charAt(0).toLowerCase() + config.service.name.slice(1);

import(`./services/${moduleName}`)
.then(module => module.default(config, options))
.catch(err => console.error(`Can't load service module ${config.service.name}`, err))
.catch(err => console.error(`Can't load service module ${moduleName}`, err))
}

return true
Expand Down

0 comments on commit 5feb120

Please sign in to comment.