Skip to content

Commit

Permalink
Remove dependency on Node.js path.
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Jan 3, 2021
1 parent 8ddb1e7 commit e5207ac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const WebSocket = require('isomorphic-ws')
const fetch = require('isomorphic-unfetch')
const path = require('path')

/**
* The Octyne API client.
Expand Down Expand Up @@ -229,8 +228,8 @@ class Client {
* @returns {Promise<void>} A Promise which resolves on success and rejects on failure.
*/
renameFile (server, oldpath, newname) {
const newName = path.join(oldpath, '..', newname)
return this.moveFile(server, oldpath, newName)
const newpath = oldpath.substring(0, oldpath.lastIndexOf('/') + 1) + newname
return this.moveFile(server, oldpath, newpath)
}

/**
Expand Down

0 comments on commit e5207ac

Please sign in to comment.