Skip to content

Commit

Permalink
use current year by default
Browse files Browse the repository at this point in the history
  • Loading branch information
chinesedfan committed Oct 17, 2017
1 parent 03b8bc6 commit 61f6514
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ ps.

## How to run

- `[YEAR=2015] node index.js <day> [part] < input.txt`, by default, `part` is `1`.
By default, `part` is `1`, and `YEAR` is the current year.

- `[YEAR=2015] node index.js <day> [part] < input.txt`
- `[YEAR=2015] node index.js <day> [part] -f input.txt`

## Summary
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var fs = require('fs');
var path = require('path');

var args = process.argv.slice(2);
var year = process.env.YEAR || '2015';
var year = process.env.YEAR || (new Date()).getFullYear();
var day, part, solve;

if (args.length < 1) {
Expand Down

0 comments on commit 61f6514

Please sign in to comment.