File tree 6 files changed +17
-11
lines changed
6 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
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
+
3
8
## v0.4.0 (7 Oct 2016)
4
9
- Windows compatibility via npm distribution
5
10
Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
- VERSION=" v0.4.0 "
5
+ VERSION=" v0.4.1 "
6
6
IMAGE=" empiricalci/emp:$VERSION "
7
7
8
8
# Functions
Original file line number Diff line number Diff line change @@ -40,10 +40,10 @@ function captureDirectory () {
40
40
} )
41
41
}
42
42
43
- function dataCLI ( subcommand , source ) {
43
+ function dataCLI ( subcommand , source , dir ) {
44
44
switch ( subcommand ) {
45
45
case 'get' :
46
- return data . get ( source ) . then ( function ( info ) {
46
+ return data . get ( source , dir ) . then ( function ( info ) {
47
47
logger . json ( info )
48
48
} ) . catch ( function ( err ) {
49
49
logger . error ( err . message )
@@ -94,7 +94,7 @@ function execute (args) {
94
94
console . log ( 'Logged out successfully. Credentials cleared.' )
95
95
} )
96
96
case 'data' :
97
- return dataCLI ( args . _ [ 3 ] , args . _ [ 4 ] )
97
+ return dataCLI ( args . _ [ 3 ] , args . _ [ 4 ] , args . dir )
98
98
case 'version' :
99
99
return version ( )
100
100
default :
@@ -103,7 +103,7 @@ function execute (args) {
103
103
}
104
104
105
105
config . load ( ) . then ( function ( ) {
106
- var argv = require ( 'minimist' ) ( process . argv )
106
+ var argv = require ( 'minimist' ) ( process . argv , { boolean : 'dir' } )
107
107
client . init ( {
108
108
host : process . env . EMPIRICAL_HOST ,
109
109
auth : process . env . EMPIRICAL_AUTH
Original file line number Diff line number Diff line change 1
1
2
2
const cache = require ( 'dataset-cache' )
3
3
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 ) {
6
6
// Show source url
7
7
data . url = url
8
8
// Don't display unecessary variables
Original file line number Diff line number Diff line change @@ -21,8 +21,9 @@ exports.data = function () {
21
21
Usage: emp data SUBCOMMAND args
22
22
23
23
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
26
27
`
27
28
console . log ( usage )
28
29
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " empirical-cli" ,
3
- "version" : " 0.4.0 " ,
3
+ "version" : " 0.4.1 " ,
4
4
"description" : " Empirical Package Manager" ,
5
5
"bin" : {
6
6
"emp" : " ./index.js"
24
24
"dependencies" : {
25
25
"amqplib" : " ^0.4.0" ,
26
26
"colors" : " ^1.1.2" ,
27
- "dataset-cache" : " ^1. 2.0" ,
27
+ "dataset-cache" : " ^2.0.1 " ,
28
28
"debug" : " ^2.2.0" ,
29
29
"dockerise" : " ^2.1.4" ,
30
30
"dockerode" : " ^2.3.0" ,
You can’t perform that action at this time.
0 commit comments