This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from DolbyIO/release/3.8.1-beta.3
Relese 3.8.1-beta.3
- Loading branch information
Showing
6 changed files
with
38 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const path = require('path'); | ||
const fs = require("fs"); | ||
|
||
function createModelsModule() { | ||
const packageJsonPath = path.join(__dirname, '..', 'package.json'); | ||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); | ||
|
||
var modelDirectory = path.join(root, "models"); | ||
|
||
const modelPackageJson = { | ||
name: "models", | ||
version: packageJson.version, | ||
main: "../lib/commonjs/models", | ||
module: "../lib/module/models", | ||
types: "../lib/typescript/models.d.ts", | ||
"react-native": "../src/models", | ||
source: "../src/models" | ||
}; | ||
|
||
if (!fs.existsSync(modelDirectory)) { | ||
fs.mkdirSync(modelDirectory); | ||
} | ||
|
||
const modelPackageJsonPath = path.join(modelDirectory, 'package.json'); | ||
fs.writeFileSync(modelPackageJsonPath, JSON.stringify(modelPackageJson, null, 2)); | ||
|
||
console.log(`Generated models package.json at ${modelPackageJsonPath}`); | ||
} | ||
|
||
const root = path.resolve(__dirname, '..'); | ||
createModelsModule(); | ||
|
||
process.exitCode = 0; |