Skip to content

Commit

Permalink
Final bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wpscholar committed Nov 3, 2023
1 parent dde1408 commit c9959c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
19 changes: 12 additions & 7 deletions .scripts/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ public function __construct() {
$this->copyFile( "{$path}/hooks/actions/init.php", "{$path}/hooks/actions/init.php" );
$this->copyFile( "{$path}/wp-plugin.php", "{$path}/{$this->get('pluginSlug')}.php" );

mkdir( "{$path}/.github" );
mkdir( "{$path}/.github/workflows" );

$this->copyFile( "{$path}/.templates/upload-artifact-on-push.yml", "{$path}/.github/workflows/upload-artifact-on-push.yml" );
Expand All @@ -153,12 +152,6 @@ public function __construct() {
$this->delete( "{$path}/wp-plugin.php" );
}

echo PHP_EOL . 'Initializing Git...' . PHP_EOL;

$this->delete( "{$path}/.git" );
exec( 'git init' );
exec( 'git branch -m main' );

echo PHP_EOL . 'Setting up NPM...' . PHP_EOL;

$this->copyFile( "{$path}/.nvmrc", "{$path}/.nvmrc" );
Expand All @@ -174,6 +167,15 @@ public function __construct() {
$this->delete( "{$path}/composer.lock" );
exec( 'composer install' );

echo PHP_EOL . 'Initializing Git...' . PHP_EOL;

$this->delete( "{$path}/.git" );

chdir( $path );
exec( 'git init' );
exec( 'git branch -m main' );
exec( "git commit -am 'Initial commit'" );

echo PHP_EOL . 'Cleaning up...' . PHP_EOL;

$this->delete( "{$path}/.templates" );
Expand All @@ -185,6 +187,9 @@ public function __construct() {
echo 'Make sure to set SVN_USERNAME and SVN_PASSWORD as secrets on GitHub for SVN deployments to work properly.' . PHP_EOL . PHP_EOL;
}

echo 'Run `git remote add origin [url]` to add your GitHub repo URL.' . PHP_EOL;
echo 'Run `git push -u origin main` to push your code.' . PHP_EOL . PHP_EOL;

echo "You can now run `cd {$this->get('pluginSlug')} && npm start` to start the development environment." . PHP_EOL;

}
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ Don't forget to:

- Run `git remote add origin <url>` to add your remote repository
- Add a `SVN_USERNAME` and `SVN_PASSWORD` environment variable to your GitHub repository settings (if your plugin is to
be publicly released)
be publicly released)
- Push your code to GitHub by running `git push -u origin master`

0 comments on commit c9959c9

Please sign in to comment.