Skip to content

Commit e488aff

Browse files
author
Calvin Allen
committed
Update to display version in log
1 parent aef81f8 commit e488aff

File tree

3 files changed

+133
-128
lines changed

3 files changed

+133
-128
lines changed

dist/index.js

Lines changed: 119 additions & 118 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"format": "prettier --write ./src/**/*.ts",
1010
"format-check": "prettier --check ./src/**/*.ts",
1111
"lint": "eslint ./src/**/*.ts",
12-
"package": "ncc build --source-map --license licenses.txt",
12+
"package": "ncc build",
1313
"test": "jest",
1414
"all": "npm run build && npm run format && npm run lint && npm run package && npm test"
1515
},

src/main.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@ const VSIX_SOURCE_PATH = core.getInput('extension-source-file', {
1313
})
1414
const BUILD_NUMBER = core.getInput('build-number') || github.context.runNumber
1515
const NOW = new Date()
16+
const VERSION = `${NOW.getFullYear()}.${
17+
NOW.getMonth() + 1
18+
}.${NOW.getDate()}.${BUILD_NUMBER}`
1619

1720
async function run(): Promise<void> {
1821
try {
22+
console.log("********************************")
23+
console.log(`Version Evaluted = ${VERSION}`)
24+
console.log("********************************")
25+
26+
core.setOutput('version', VERSION)
27+
1928
if (IS_WINDOWS === false) {
2029
core.setFailed(
2130
'action-vs-vsix-versioner can only be run on Windows-based runners'
@@ -33,15 +42,10 @@ async function run(): Promise<void> {
3342
return
3443
}
3544

36-
const VERSION = `${NOW.getFullYear()}.${
37-
NOW.getMonth() + 1
38-
}.${NOW.getDate()}.${BUILD_NUMBER}`
39-
core.setOutput('version', VERSION)
40-
4145
fs.readFile(
4246
VSIX_MANIFEST_PATH,
4347
{encoding: 'utf-8'},
44-
function (manifestReadError, data) {
48+
function (manifestReadError: any, data: any) {
4549
if (manifestReadError) {
4650
core.setFailed(
4751
`Unable to READ VSIX Manifest. Error: '${manifestReadError}'`
@@ -68,7 +72,7 @@ async function run(): Promise<void> {
6872
fs.writeFile(
6973
VSIX_MANIFEST_PATH,
7074
xmlContent,
71-
function (manifestWriteError) {
75+
function (manifestWriteError: any) {
7276
if (manifestWriteError) {
7377
core.setFailed(
7478
`Unable to UPDATE VSIX Manifest. Error: '${manifestWriteError}'`
@@ -86,7 +90,7 @@ async function run(): Promise<void> {
8690
fs.readFile(
8791
VSIX_SOURCE_PATH,
8892
{encoding: 'utf-8'},
89-
function (sourceReadError, data) {
93+
function (sourceReadError: any, data: string) {
9094
if (sourceReadError) {
9195
core.setFailed(
9296
`Unable to READ VSIX Source File. Error: '${sourceReadError}'`
@@ -98,7 +102,7 @@ async function run(): Promise<void> {
98102
fs.writeFile(
99103
VSIX_SOURCE_PATH,
100104
updatedData,
101-
function (sourceWriteError) {
105+
function (sourceWriteError: any) {
102106
if (sourceWriteError) {
103107
core.setFailed(
104108
`Unable to UPDATE VSIX Source File. Error: '${sourceWriteError}'`

0 commit comments

Comments
 (0)