Skip to content

Commit

Permalink
Merge pull request #6 from mattstrom/issues/issue-3
Browse files Browse the repository at this point in the history
issues/issue-3
  • Loading branch information
mattstrom authored Jul 19, 2018
2 parents 62824f5 + c8cf158 commit 3128234
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 7 deletions.
55 changes: 55 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
- build:
docker:
# specify the version you desire here
- image: circleci/node:10.4.1

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/repos

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: npm ci

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# run tests!
- run: npm test

- publish:
docker:
- image: circleci/node:10.4.1
steps:
- checkout
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: npm publish

workflows:
version: 2
tagged-build:
jobs:
- publish:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.idea
.vscode

dist/
node_modules
npm-debug.log
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sudo: false
language: node_js
node_js:
- 9.11.1
- 10.4.1
cache:
directories:
- "$HOME/.npm"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commander-ts",
"version": "0.1.4",
"version": "0.1.5",
"description": "TypeScript decorators that enhance commander",
"keywords": [
"command line",
Expand All @@ -13,6 +13,7 @@
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc",
"exec": "node dist/program.js",
"test": "echo \"No tests yet\""
},
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/decorators/command.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function command(): MethodDecorator {
const cmdArgs = args.slice(0, args.length - 1);

try {
const result = target[propertyKey].apply(target, cmdArgs);
const result = target[propertyKey].apply(context, cmdArgs);

if (result instanceof Promise) {
await result;
Expand Down
2 changes: 1 addition & 1 deletion src/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
@description('A basic program')
@usage('--help')
export class Program {
@option('--env <env>')
@option('--env <env>', 'Set the environment')
env: string = null;

constructor() {}
Expand Down
4 changes: 1 addition & 3 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rulesDirectory": [],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
Expand Down

0 comments on commit 3128234

Please sign in to comment.