Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Fixes #954 - jsipfs fails with error when adding directory with trailing slash #985

Merged
merged 1 commit into from
Sep 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/cli/commands/files/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ function checkPath (inPath, recursive) {
throw new Error('Error: Argument \'path\' is required')
}

// Strips trailing slash from path.
inPath = inPath.replace(/\/$/, '')

if (inPath === '.') {
inPath = process.cwd()
}
Expand Down
Loading