RangerMauve / dat-store

A CLI tool for backing up hyperdrive datasets
GNU Affero General Public License v3.0
59 stars 14 forks source link

clone command doesn't seem to work #44

Closed Powersource closed 4 years ago

Powersource commented 4 years ago

Running run-service in the background, I've added an archive and it shows up when I list but when I then try to clone it to a dir it doesn't work (parts censored)

% ./bin.js clone ../../../dir/ectory hyper://asdfasdf/
dat-store clone <path> <url> [provider]

Sync changes from a Dat into a local folder.

Options:
  --version                  Show version number                       [boolean]
  --help                     Show help                                 [boolean]
  --storage-location         The folder to store dats in
  --port                     The port to use for the HTTP API    [default: 3472]
  --host                     The hostname to make the HTTP server listen on
  --verbose                  Whether the HTTP server should output logs
                                                       [boolean] [default: true]
  --p2p-port                 The port to listen for P2P connections on
                                                                 [default: 3282]
  --latest                   Whether to download just the latest changes
                                                      [boolean] [default: false]
  --allow-cors               Allow CORS requests so any website can talk to the
                             store                    [boolean] [default: false]
  --expose-to-internet       Allow connections from the internet, not just the
                             localhost                [boolean] [default: false]
  --authentication-username  Require users to use Basic Auth with this username
                             to connect                   [string] [default: ""]
  --authentication-password  Require users to use Basic Auth with this password
                             to connect                            [default: ""]
  --manifest-timeout         time out if the PDA cannot be read with timeout
                             milliseconds                         [default: 500]

TypeError: getService(...).clone is not a function
    at Object.clone [as handler] (/home/me/prj/web/dat-store/index.js:90:26)
    at Object.runCommand (/home/me/prj/web/dat-store/node_modules/yargs/lib/command.js:242:26)
    at Object.parseArgs [as _parseArgs] (/home/me/prj/web/dat-store/node_modules/yargs/yargs.js:1087:30)
    at Object.parse (/home/me/prj/web/dat-store/node_modules/yargs/yargs.js:575:25)
    at module.exports (/home/me/prj/web/dat-store/index.js:74:12)
    at Object.<anonymous> (/home/me/prj/web/dat-store/bin.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1256:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10)
    at Module.load (internal/modules/cjs/loader.js:1105:32)
    at Function.Module._load (internal/modules/cjs/loader.js:967:14)

Repo just now cloned and npm i'd

RangerMauve commented 4 years ago

Oh shoot. I'll take a look now.

RangerMauve commented 4 years ago

I'm not sure if I accounted for stuff being both added and cloned at the same time. 🤔

RangerMauve commented 4 years ago

Thank you for opening the issue! I guess I haven't tested clone in a while. 😅 (and it's not in the unit tests it seems 😱)

Should be fixed in dat-store@6.0.3 😁

Powersource commented 4 years ago

Wow 2fast! Will try again :)

Powersource commented 4 years ago

Seems to work!