undocs 0.2.25 → 0.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/setup.mjs +13 -1
- package/package.json +1 -1
package/cli/setup.mjs
CHANGED
|
@@ -101,8 +101,20 @@ function inferSiteURL() {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
function getGitBranch() {
|
|
104
|
+
const envName =
|
|
105
|
+
process.env.CF_PAGES_BRANCH ||
|
|
106
|
+
process.env.CI_COMMIT_BRANCH ||
|
|
107
|
+
process.env.VERCEL_BRANCH_URL ||
|
|
108
|
+
process.env.BRANCH ||
|
|
109
|
+
process.env.GITHUB_REF_NAME
|
|
110
|
+
if (envName && envName !== 'HEAD') {
|
|
111
|
+
return envName
|
|
112
|
+
}
|
|
104
113
|
try {
|
|
105
|
-
|
|
114
|
+
const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim()
|
|
115
|
+
if (branch && branch !== 'HEAD') {
|
|
116
|
+
return branch
|
|
117
|
+
}
|
|
106
118
|
} catch {
|
|
107
119
|
// Ignore
|
|
108
120
|
}
|