diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx index bb6ff7f4..9f1ce014 100644 --- a/src/pages/settings.jsx +++ b/src/pages/settings.jsx @@ -665,10 +665,10 @@ function Settings({ onClose }) { type="text" class="version-string" readOnly - size="18" // Manually calculated here + size={10 /* build time */ + (1+8) /* commit hash */ + '-dtth'.length} value={`${__BUILD_TIME__.slice(0, 10).replace(/-/g, '.')}${ - __COMMIT_HASH__ ? `.${__COMMIT_HASH__}` : '' - }`} + __COMMIT_HASH__ ? `.${__COMMIT_HASH__.slice(0, 8)}` : '' + }-dtth`} onClick={(e) => { e.target.select(); // Copy to clipboard diff --git a/vite.config.js b/vite.config.js index b66daa95..db7d6317 100644 --- a/vite.config.js +++ b/vite.config.js @@ -24,8 +24,12 @@ try { } catch (error) { // If error, means git is not installed or not a git repo (could be downloaded instead of git cloned) // Fallback to random hash which should be different on every build run 🤞 - commitHash = uid(); - fakeCommitHash = true; + if (process.env.PHANPY_COMMIT_HASH) { + commitHash = process.env.PHANPY_COMMIT_HASH; + } else { + commitHash = uid(); + fakeCommitHash = true; + } } const rollbarCode = fs.readFileSync(