diff --git a/scripts/post-build.js b/scripts/post-build.js index d2185953f2..fa3eccd89a 100644 --- a/scripts/post-build.js +++ b/scripts/post-build.js @@ -2,10 +2,14 @@ const { computePackageDigest } = require('./lib/bundle') const execa = require('execa') const { generatedPath, rawCompilerOptionsFileName } = require('./lib/paths') -if (execa.sync('git', ['diff-index', '--name-only', 'HEAD']).stdout.includes(rawCompilerOptionsFileName)) { - throw new Error( - `Tsconfig options have changed. Please check the modified generated ${generatedPath} and commit the change` - ) +try { + execa.sync('git', ['--version']) + if (execa.sync('git', ['diff-index', '--name-only', 'HEAD']).stdout.includes(rawCompilerOptionsFileName)) { + throw new Error( + `Tsconfig options have changed. Please check the modified generated ${generatedPath} and commit the change` + ) + } +} catch (e) { + console.log('git command is not available. Skip checking generated types') } - computePackageDigest()