Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
1dc97424
Unverified
Commit
1dc97424
authored
Sep 15, 2021
by
Rainshaw
Committed by
GitHub
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: sftp error when dir already exists (#4024)
when the dir exists, sftp.mkdir() would raise an error and ends the for loop.
parent
54505976
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
storage.js
server/modules/storage/sftp/storage.js
+6
-1
No files found.
server/modules/storage/sftp/storage.js
View file @
1dc97424
...
@@ -155,7 +155,12 @@ module.exports = {
...
@@ -155,7 +155,12 @@ module.exports = {
const
folderPaths
=
_
.
dropRight
(
filePath
.
split
(
'/'
))
const
folderPaths
=
_
.
dropRight
(
filePath
.
split
(
'/'
))
for
(
let
i
=
1
;
i
<=
folderPaths
.
length
;
i
++
)
{
for
(
let
i
=
1
;
i
<=
folderPaths
.
length
;
i
++
)
{
const
folderSection
=
_
.
take
(
folderPaths
,
i
).
join
(
'/'
)
const
folderSection
=
_
.
take
(
folderPaths
,
i
).
join
(
'/'
)
await
this
.
sftp
.
mkdir
(
path
.
posix
.
join
(
this
.
config
.
basePath
,
folderSection
))
const
folderDir
=
path
.
posix
.
join
(
this
.
config
.
basePath
,
folderSection
)
try
{
await
this
.
sftp
.
readdir
(
folderDir
)
}
catch
(
err
)
{
await
this
.
sftp
.
mkdir
(
folderDir
)
}
}
}
}
catch
(
err
)
{}
}
catch
(
err
)
{}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment