Skip to content

Commit

Permalink
change script to commonjs
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Jun 3, 2024
1 parent 4cd0cd1 commit 6c550b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@wcpos/managed-expo",
"version": "1.5.3",
"version": "1.5.4",
"main": "index.js",
"author": "kilbot <paul@kilbot.com>",
"homepage": ".",
Expand All @@ -25,7 +25,7 @@
"eas-build-on-error": "echo 'Error'",
"eas-build-on-complete": "echo 'Complete'",
"postinstall": "patch-package",
"preinstall": "chmod +x ./scripts/install-rxdb-license.ts && npx ts-node ./scripts/install-rxdb-license.ts"
"preinstall": "chmod +x ./scripts/install-rxdb-license.js && node ./scripts/install-rxdb-license.js"
},
"dependencies": {
"@react-native-community/netinfo": "11.3.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env node
import * as dotenv from 'dotenv';
import { readJson, writeJson } from 'fs-extra';
const dotenv = require('dotenv');
const { readJson, writeJson } = require('fs-extra');

console.log('Starting preinstall script...');

async function addLicenseToPackageJson() {
dotenv.config();
Expand All @@ -13,6 +15,7 @@ async function addLicenseToPackageJson() {

const packageJsonPath = './package.json'; // Adjust path as necessary
try {
console.log('Reading package.json...');
const packageJson = await readJson(packageJsonPath);

// Ensuring accessTokens object exists
Expand All @@ -23,6 +26,7 @@ async function addLicenseToPackageJson() {
// Adding the license key to rxdb-premium in accessTokens
packageJson.accessTokens['rxdb-premium'] = licenseKey;

console.log('Writing updated package.json...');
await writeJson(packageJsonPath, packageJson, { spaces: 2 });
console.log('License key added to package.json under accessTokens');
} catch (error) {
Expand Down

0 comments on commit 6c550b3

Please sign in to comment.