@alexbainter/s3-sync
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -143,2 +143,25 @@ #!/usr/bin/env node | ||
) | ||
.command( | ||
'diff', | ||
"Show files which aren't shared between the bucket and local directory", | ||
{ | ||
bucket: { | ||
descrption: | ||
'The name of the bucket to download from (requires read access)', | ||
type: 'string', | ||
requiresArg: true, | ||
nargs: 1, | ||
demand: true, | ||
}, | ||
directory: { | ||
alias: 'dir', | ||
descrption: 'The local directory to download files to', | ||
type: 'string', | ||
requiresArg: true, | ||
nargs: 1, | ||
demand: true, | ||
default: 'dist', | ||
}, | ||
} | ||
) | ||
.env('S3_SYNC') | ||
@@ -145,0 +168,0 @@ .help() |
'use strict'; | ||
const getFilenames = require('../shared/get-filenames'); | ||
const getDestinationFilename = require('../shared/get-destination-filename'); | ||
const getLocalDestinationFilename = require('../shared/get-local-destination-filename'); | ||
@@ -21,3 +21,3 @@ const MAX_OBJECT_COUNT_PER_REQUEST = 1000; | ||
const deleteFilenames = remoteFilenames.filter((remoteFilename) => { | ||
const destinationFilename = getDestinationFilename( | ||
const destinationFilename = getLocalDestinationFilename( | ||
remoteFilename, | ||
@@ -24,0 +24,0 @@ distDir |
@@ -5,3 +5,3 @@ 'use strict'; | ||
const getFilenames = require('../shared/get-filenames'); | ||
const getDestinationFilename = require('../shared/get-destination-filename'); | ||
const getLocalDestinationFilename = require('../shared/get-local-destination-filename'); | ||
const downloadFile = require('./download-file'); | ||
@@ -14,3 +14,3 @@ | ||
const downloadFilenames = remoteFilenames.filter((remoteFilename) => { | ||
const destinationFilename = getDestinationFilename( | ||
const destinationFilename = getLocalDestinationFilename( | ||
remoteFilename, | ||
@@ -39,3 +39,6 @@ distDir | ||
downloadFilenames.map((remotePath) => { | ||
const destinationPath = getDestinationFilename(remotePath, distDir); | ||
const destinationPath = getLocalDestinationFilename( | ||
remotePath, | ||
distDir | ||
); | ||
const downloadPromise = dryRun | ||
@@ -42,0 +45,0 @@ ? Promise.resolve() |
@@ -7,6 +7,4 @@ 'use strict'; | ||
const uploadFile = require('./upload-file'); | ||
const getRemoteDestinationFilename = require('../shared/get-remote-destination-filename'); | ||
const getDestinationFilename = (localFilename, distDir) => | ||
localFilename.replace(distDir.endsWith('/') ? distDir : `${distDir}/`, ''); | ||
const push = ({ | ||
@@ -23,3 +21,3 @@ s3, | ||
const uploadFilenames = localFilenames.filter((localFilename) => { | ||
const destinationFilename = getDestinationFilename( | ||
const destinationFilename = getRemoteDestinationFilename( | ||
localFilename, | ||
@@ -55,3 +53,6 @@ distDir | ||
uploadFilenames.map((localPath) => { | ||
const destinationPath = getDestinationFilename(localPath, distDir); | ||
const destinationPath = getRemoteDestinationFilename( | ||
localPath, | ||
distDir | ||
); | ||
const uploadPromise = dryRun | ||
@@ -58,0 +59,0 @@ ? Promise.resolve({ Key: destinationPath }) |
{ | ||
"name": "@alexbainter/s3-sync", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "Transfer files to and from S3", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24645
21
660