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:
authorShohei Ueda <30958501+peaceiris@users.noreply.github.com>2022-05-09 16:23:08 +0300
committerGitHub <noreply@github.com>2022-05-09 16:23:08 +0300
commit4717a413f5230a73a15c775871fbae53d27cee2d (patch)
tree06c630ea5872b4e5b91a456c9941a7110427eb24
parentc22dd4600493f4f4b1d3d659b0a88b6eb834117c (diff)
chore: add bump-node task (#526)
-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