localizely / intl_utils

Dart package that creates a binding between your translations from .arb files and your Flutter app
BSD 3-Clause "New" or "Revised" License
135 stars 81 forks source link

If the arb directory does not exist in project, intl_utils:localizely_download fails on FileSystemException #97

Open lpickford-pixelbeard opened 1 year ago

lpickford-pixelbeard commented 1 year ago

We have our /lib/intl directory on gitignore and run the following script on our build server:

flutter pub run intl_utils:localizely_download --api-token $INTL_TOKEN
flutter pub run intl_utils:generate

If the arb directory doesn't exist for the localization files then the tool errors with:

ERROR: Failed to download ARB files from Localizely.
FileSystemException: Cannot create file, path = '/Users/builder/clone/lib/l10n/intl_pt.arb' (OS Error: No such file or directory, errno = 2)
pub finished with exit code 2

A check to see if the directory exists and creating it if not should fix this.

Otherwise for anyone else doing this on their build server, adding the command mkdir lib/l10n (or whatever your arb directory is) before downloading will fix this.