-function put(filePath, otherFilePaths, options) {
- checkConfig();
-
- var files = collectFiles([ filePath ].concat(otherFilePaths));
+function putOne(filePath, destination, options, callback) {
+ const absoluteFilePath = path.resolve(filePath);
+ const stat = safe.fs.statSync(absoluteFilePath);
+ if (!stat) return callback(`Could not stat ${filePath}: ${safe.error.message}`);
+
+ let files, base;
+
+ if (stat.isFile()) {
+ base = destination + path.basename(filePath);
+ files = [ absoluteFilePath ];
+ } else if (stat.isDirectory()) {
+ base = destination + (filePath.endsWith('.') ? '' : path.basename(filePath) + '/');
+ files = collectFiles([ absoluteFilePath ], options);
+ } else {
+ return callback(); // ignore
+ }