Skip to content

Commit 88137d4

Browse files
authored
🚀 v0.4.1 (#99)
1 parent 8faa80d commit 88137d4

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## v0.4.1 (11 Oct 2016)
4+
- Upgrade dataset-cache to v2.0.1. This change makes it required to pass a
5+
``directory: true`` flag when the resource is going to be extracted to a directory from ``.zip`` or ``.tar.gz``
6+
- ``emp data --dir URL.(zip|tar.gz)`` will download the file and extract the contents to a directory
7+
38
## v0.4.0 (7 Oct 2016)
49
- Windows compatibility via npm distribution
510

bin/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
VERSION="v0.4.0"
5+
VERSION="v0.4.1"
66
IMAGE="empiricalci/emp:$VERSION"
77

88
# Functions

index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ function captureDirectory () {
4040
})
4141
}
4242

43-
function dataCLI (subcommand, source) {
43+
function dataCLI (subcommand, source, dir) {
4444
switch (subcommand) {
4545
case 'get':
46-
return data.get(source).then(function (info) {
46+
return data.get(source, dir).then(function (info) {
4747
logger.json(info)
4848
}).catch(function (err) {
4949
logger.error(err.message)
@@ -94,7 +94,7 @@ function execute (args) {
9494
console.log('Logged out successfully. Credentials cleared.')
9595
})
9696
case 'data':
97-
return dataCLI(args._[3], args._[4])
97+
return dataCLI(args._[3], args._[4], args.dir)
9898
case 'version':
9999
return version()
100100
default:
@@ -103,7 +103,7 @@ function execute (args) {
103103
}
104104

105105
config.load().then(function () {
106-
var argv = require('minimist')(process.argv)
106+
var argv = require('minimist')(process.argv, {boolean: 'dir'})
107107
client.init({
108108
host: process.env.EMPIRICAL_HOST,
109109
auth: process.env.EMPIRICAL_AUTH

lib/data.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
const cache = require('dataset-cache')
33

4-
exports.get = function (url) {
5-
return cache.get({url: url}, process.env.DATA_PATH).then(function (data) {
4+
exports.get = function (url, dir) {
5+
return cache.get({url: url, directory: dir}, process.env.DATA_PATH).then(function (data) {
66
// Show source url
77
data.url = url
88
// Don't display unecessary variables

lib/usage.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ exports.data = function () {
2121
Usage: emp data SUBCOMMAND args
2222
2323
Subcommands:
24-
get url Gets a data file from a url
25-
hash file Print the hash of a file or directory
24+
get --dir url Gets a directory from a url to a .zip or .tar.gz
25+
url Gets a file from a url
26+
hash path Print the hash of a file or directory
2627
`
2728
console.log(usage)
2829
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "empirical-cli",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Empirical Package Manager",
55
"bin": {
66
"emp": "./index.js"
@@ -24,7 +24,7 @@
2424
"dependencies": {
2525
"amqplib": "^0.4.0",
2626
"colors": "^1.1.2",
27-
"dataset-cache": "^1.2.0",
27+
"dataset-cache": "^2.0.1",
2828
"debug": "^2.2.0",
2929
"dockerise": "^2.1.4",
3030
"dockerode": "^2.3.0",

0 commit comments

Comments
 (0)