aboutsummaryrefslogtreecommitdiffhomepage
path: root/cli
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2017-02-07 16:26:17 +0100
committerJohannes Zellner <johannes@cloudron.io>2017-02-07 16:26:19 +0100
commite628921a338684a4bc3f196c5c39beba8b8f9b68 (patch)
treea4112c316e69b4d0a302af23f5bb8f4396c15c30 /cli
parent4b6cf0add4f4f89671f4553a9672a01fbb485df1 (diff)
downloadSurfer-e628921a338684a4bc3f196c5c39beba8b8f9b68.tar.gz
Surfer-e628921a338684a4bc3f196c5c39beba8b8f9b68.tar.zst
Surfer-e628921a338684a4bc3f196c5c39beba8b8f9b68.zip
Add rename functionality
This also break backwardscompat since PUT is now POST and PUT is used for renaming
Diffstat (limited to 'cli')
-rw-r--r--cli/actions.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/actions.js b/cli/actions.js
index 69ffa10..ea2a3a1 100644
--- a/cli/actions.js
+++ b/cli/actions.js
@@ -118,7 +118,7 @@ function put(filePath, otherFilePaths, options) {
118 var destinationPath = (destination ? '/' + destination : '') + '/' + relativeFilePath; 118 var destinationPath = (destination ? '/' + destination : '') + '/' + relativeFilePath;
119 console.log('Uploading file %s -> %s', relativeFilePath.cyan, destinationPath.cyan); 119 console.log('Uploading file %s -> %s', relativeFilePath.cyan, destinationPath.cyan);
120 120
121 superagent.put(config.server() + API + destinationPath).query(gQuery).attach('file', file).end(function (error, result) { 121 superagent.post(config.server() + API + destinationPath).query(gQuery).attach('file', file).end(function (error, result) {
122 if (result && result.statusCode === 403) return callback(new Error('Upload destination ' + destinationPath + ' not allowed')); 122 if (result && result.statusCode === 403) return callback(new Error('Upload destination ' + destinationPath + ' not allowed'));
123 if (result && result.statusCode !== 201) return callback(new Error('Error uploading file: ' + result.statusCode)); 123 if (result && result.statusCode !== 201) return callback(new Error('Error uploading file: ' + result.statusCode));
124 if (error) return callback(error); 124 if (error) return callback(error);