Skip to content

Commit

Permalink
Assure directory for localization strings files output
Browse files Browse the repository at this point in the history
  • Loading branch information
fluiddot committed Jan 17, 2022
1 parent 628e86f commit 464565f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/strings2android.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ if ( require.main === module ) {
}

const xmlOutput = strings2Android( onlyNativeStrings );

// Assure that the destination directory exists
const destinationDir = path.dirname( destination );
if ( ! fs.existsSync( destinationDir ) ) {
fs.mkdirSync( destinationDir, { recursive: true } );
}

fs.writeFileSync( destination, xmlOutput );
}

Expand Down
7 changes: 7 additions & 0 deletions bin/strings2swift.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ if ( require.main === module ) {
}

const swiftOutput = strings2Swift( onlyNativeStrings );

// Assure that the destination directory exists
const destinationDir = path.dirname( destination );
if ( ! fs.existsSync( destinationDir ) ) {
fs.mkdirSync( destinationDir, { recursive: true } );
}

fs.writeFileSync( destination, swiftOutput );
}

Expand Down

0 comments on commit 464565f

Please sign in to comment.