mirror of
https://github.com/aljazceru/react-native-pubky.git
synced 2025-12-17 14:44:26 +01:00
refactor: remove rust project
Removes rust directory containing the pubky library. Updates build scripts to include local and remote options. Updates README.md. Adds simple-git as a dev dependency.
This commit is contained in:
49
setup-local-ios-bindings.js
Normal file
49
setup-local-ios-bindings.js
Normal file
@@ -0,0 +1,49 @@
|
||||
const fs = require('fs').promises;
|
||||
const path = require('path');
|
||||
|
||||
const frameworkPath = 'rust/bindings/ios/PubkyMobile.xcframework';
|
||||
const frameworkDestinationPath = 'ios/Frameworks';
|
||||
const swiftFilePath = 'rust/bindings/ios/pubkymobile.swift';
|
||||
const swiftDestinationPath = 'ios/';
|
||||
|
||||
async function runSetup() {
|
||||
try {
|
||||
console.log('Removing existing files...');
|
||||
// Remove destination directories if they exist
|
||||
await Promise.all([
|
||||
fs.rm(frameworkDestinationPath, { recursive: true, force: true }),
|
||||
fs.rm('ios/pubkymobile.swift', { recursive: true, force: true }),
|
||||
]);
|
||||
|
||||
console.log('Creating directories...');
|
||||
// Create destination directories if they don't exist
|
||||
await Promise.all([
|
||||
fs.mkdir(frameworkDestinationPath, { recursive: true }),
|
||||
fs.mkdir(swiftDestinationPath, { recursive: true }),
|
||||
]);
|
||||
|
||||
// Copy framework to destination
|
||||
const frameworkTargetPath = path.join(
|
||||
frameworkDestinationPath,
|
||||
path.basename(frameworkPath)
|
||||
);
|
||||
await fs.cp(frameworkPath, frameworkTargetPath, { recursive: true });
|
||||
|
||||
// Copy Swift file to destination
|
||||
const swiftTargetPath = path.join(
|
||||
swiftDestinationPath,
|
||||
path.basename(swiftFilePath)
|
||||
);
|
||||
await fs.copyFile(swiftFilePath, swiftTargetPath);
|
||||
|
||||
console.log('Framework and Swift file copied successfully!');
|
||||
} catch (error) {
|
||||
console.error('Error during setup:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
runSetup().catch((error) => {
|
||||
console.error('Unhandled error:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user