Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/peaceiris/hugo-theme-iris.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--scripts/bump_node.sh18
2 files changed, 22 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 90f4a98d..b1a43a0f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,10 @@ DOCKER_COMPOSE := docker compose
GH_USER_ID := peaceiris
+.PHONY: bump-node
+bump-node:
+ bash scripts/bump_node.sh
+
.PHONY: npm-ci
npm-ci:
npm ci
diff --git a/scripts/bump_node.sh b/scripts/bump_node.sh
new file mode 100644
index 00000000..a2f0a372
--- /dev/null
+++ b/scripts/bump_node.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+# fail on unset variables and command errors
+set -eu -o pipefail # -x: is for debugging
+
+NVMRC_PATH=".nvmrc"
+CURRENT_NODE_VERSION=$(cat "${NVMRC_PATH}")
+NEW_NODE_VERSION=$(node -v)
+BRANCH_NAME="bump-node-from-${CURRENT_NODE_VERSION}-to-${NEW_NODE_VERSION#v}"
+
+echo "${NEW_NODE_VERSION#v}" > "${NVMRC_PATH}"
+
+git checkout -b "${BRANCH_NAME}"
+git add "${NVMRC_PATH}"
+git commit -m "deps(npm-dev): bump node from ${CURRENT_NODE_VERSION} to ${NEW_NODE_VERSION#v}"
+git push origin "${BRANCH_NAME}"
+gh pr create --fill
+gh pr view --web