Skip to content

Commit

Permalink
Merge pull request #86 from woocommerce/add-nvm-and-autobranching
Browse files Browse the repository at this point in the history
Add `nvm use` and auto-branching
  • Loading branch information
message-dimke authored Sep 23, 2024
2 parents 663c5a1 + 56837ac commit 6ba839e
Show file tree
Hide file tree
Showing 14 changed files with 1,221 additions and 375 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ vendor/

# All zip files
*.zip

# IDE files
.vscode/*
16 changes: 16 additions & 0 deletions bin/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

source ~/.nvm/nvm.sh
nvm use || nvm install $(cat .nvmrc)

case $1 in
pnpm)
pnpm install && pnpm run build
;;
npm)
npm install && npm run build
;;
*)
eval $1
;;
esac
20 changes: 20 additions & 0 deletions bin/nvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /bin/bash

do_check=false
do_use=false
while getopts eu opt; do
case $opt in
e) do_check=true;;
u) do_use=true;;
esac
done

source ~/.nvm/nvm.sh

if $do_check; then
command -v nvm
fi

if $do_use; then
nvm use || nvm install $(cat .nvmrc)
fi
6 changes: 6 additions & 0 deletions bin/wr
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/env php
<?php

use Automattic\WooCommerce\Grow\WR\Commands\Branch;
use Automattic\WooCommerce\Grow\WR\Commands\Bulk;
use Automattic\WooCommerce\Grow\WR\Commands\Release;
use Automattic\WooCommerce\Grow\WR\Commands\Simulate;
use Automattic\WooCommerce\Grow\WR\Commands\VersionReplace;
use WR\Application;

Expand Down Expand Up @@ -41,6 +44,9 @@ $app->addCommands(
[
new Bulk(),
new VersionReplace(),
new Release(),
new Simulate(),
new Branch(),
]
);

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ext-zip": "*",
"phpcompatibility/php-compatibility": "^9.0",
"php-parallel-lint/php-parallel-lint": "^1.3.1",
"woocommerce/woorelease": "^2.4",
"woocommerce/woorelease": "dev-trunk",
"yoast/phpunit-polyfills": "^1.0",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"wp-coding-standards/wpcs": "^3.0"
Expand Down
Loading

0 comments on commit 6ba839e

Please sign in to comment.