Skip to content

Commit

Permalink
Update version number on commit
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Jul 23, 2015
1 parent ee33c3a commit b6a82d1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@
"test-spec": "mocha dist/**/*.spec.js -R spec --bail",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- dist/**/*.spec.js -R spec --bail",
"test": "npm run build && npm run lint && npm run test-cov",
"bump-version": "FILE=\"src/typescript-node.ts\" VERSION=$(node -p \"require('./package.json').version\") && sed \"s/VERSION \\= \\'\\([0-9]*\\.[0-9]*\\.[0-9]*\\)\\'/VERSION = \\'\"$VERSION\"\\'/\" $FILE > .tmp.ts && mv .tmp.ts $FILE && git add $FILE",

This comment has been minimized.

Copy link
@PatrickJS

PatrickJS Jul 23, 2015

seems legit

"prepublish": "npm run build"
},
"pre-commit": [
"bump-version",
"test"
],
"repository": {
"type": "git",
"url": "git://github.com/blakeembrey/typescript-node.git"
Expand Down Expand Up @@ -53,7 +58,7 @@
"istanbul": "^0.3.17",
"mocha": "^2.1.0",
"ntypescript": "^1.201507091536.1",
"pre-commit": "^1.0.6",
"pre-commit": "^1.0.10",
"typescript": "^1.5.3"
},
"peerDependencies": {
Expand Down
6 changes: 5 additions & 1 deletion src/typescript-node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai'
import { exec } from 'child_process'
import { join } from 'path'
import { register } from './typescript-node'
import { register, VERSION } from './typescript-node'

const BIN_PATH = join(__dirname, '../dist/bin/ts-node')

Expand All @@ -10,6 +10,10 @@ const compiler = register()
describe('ts-node', function () {
this.timeout(5000)

it('should export the correct version', function () {
expect(VERSION).to.equal(require('../package.json').version)
})

it('should execute cli', function (done) {
exec(`node ${BIN_PATH} tests/hello-world`, function (err, stdout) {
expect(err).to.not.exist
Expand Down
5 changes: 5 additions & 0 deletions src/typescript-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import sourceMapSupport = require('source-map-support')
import extend = require('xtend')
import arrify = require('arrify')

/**
* Export the current version.
*/
export const VERSION = '0.0.6'

/**
* Extensions to compile using TypeScript.
*/
Expand Down

0 comments on commit b6a82d1

Please sign in to comment.