Skip to content

Commit

Permalink
feat!: add support for add-platform command
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak committed Aug 28, 2024
1 parent b5d4778 commit 0438e2d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
31 changes: 31 additions & 0 deletions postInitScript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import chalk from 'chalk';
import {logger} from '@react-native-community/cli-tools';
import path from 'path';

function printInitScript(
projectName: string,
) {
const relativeXcodeProjectPath = `visionos/${projectName}.xcworkspace`;
const projectDir = path.resolve();

const instructions = `
${chalk.cyan(`Run instructions for ${chalk.bold('visionOS')}`)}:
• cd "${projectDir}/visionos"
• Install Cocoapods
• bundle install # you need to run this only once in your project.
• bundle exec pod install
• cd ..
• npx react-native run-visionos
${chalk.dim('- or -')}
• Open ${relativeXcodeProjectPath} in Xcode or run "xed -b ${relativeXcodeProjectPath}"
• Hit the Run button
`;

logger.log(`
${instructions}
`);
}

export default printInitScript;
2 changes: 2 additions & 0 deletions template.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ module.exports = {
placeholderName: 'HelloWorld',
titlePlaceholder: 'Hello App Display Name',
templateDir: './template',
platforms: ['visionos'],
postInitScript: './postInitScript.js',
};

0 comments on commit 0438e2d

Please sign in to comment.