diff --git a/docs/package.json b/docs/package.json index 48453ee6..cb394d9a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -10,7 +10,7 @@ "server:dev": "cross-env NODE_ENV=development ts-node server.ts", "server:prod": "cross-env NODE_ENV=production ts-node server.ts", "build": "npm-run-all clean-react-types build:webpack build-html:prod", - "build:docs": "node scripts/gh-pages-build HEAD", + "build:docs": "node scripts/gh-pages-build", "check:build": "test -d \"./build\" && rm -r \"./build\" || exit 0", "build:ts": "npm run check:build-ts && tsc -p ./tsconfig.build.json", "build-html:dev": "cross-env NODE_ENV=development node ./scripts/buildHTML.js", diff --git a/docs/scripts/gh-pages-build.js b/docs/scripts/gh-pages-build.js index 706b78e4..14bdf704 100644 --- a/docs/scripts/gh-pages-build.js +++ b/docs/scripts/gh-pages-build.js @@ -25,7 +25,7 @@ const versions = JSON.parse(fs.readFileSync(versionsFile, 'utf8')) const versionIsHEAD = version === 'HEAD' const useForcePush = args[3] === '-p' const versionNumber = versionIsHEAD ? ( - `v${JSON.parse(fs.readFileSync('../../package.json', 'utf8')).version}` + execSync('git describe --abbrev=0 --tags').toString().trim() || 'v1.0.0' ) : version function execSyncWithLog(command) { diff --git a/docs/scripts/versions.json b/docs/scripts/versions.json index 58a81462..874a5c2a 100644 --- a/docs/scripts/versions.json +++ b/docs/scripts/versions.json @@ -19,5 +19,5 @@ "v1.2.0", "v1.2.1", "v1.2.2", - "vv1.2.3" + "v1.2.3" ] \ No newline at end of file diff --git a/package.json b/package.json index 7ec5b3b2..159cec0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-uwp", - "version": "v1.2.3", + "version": "1.2.3", "description": "UWP Design & Fluent Design UiKit by React", "main": "index.js", "scripts": { diff --git a/scripts/nextGitTag.js b/scripts/nextGitTag.js index fd819020..695c470f 100644 --- a/scripts/nextGitTag.js +++ b/scripts/nextGitTag.js @@ -14,7 +14,7 @@ const nextVersion = `v${nextVersionStr.slice(0, nextVersionStr.length - 2)}${nex console.log(`next git tag version is ${nextVersion}`) const packageData = require('../package.json') -packageData.version = `${nextVersion}` +packageData.version = `${nextVersion.slice(1)}` fs.writeFileSync('../package.json', JSON.stringify(packageData, null, 2)) runCommandsAndLog(