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
566043ec
Commit
566043ec
authored
Apr 24, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: perform git move manually to prevent bad source
parent
c9e7811c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
storage.js
server/modules/storage/git/storage.js
+10
-5
No files found.
server/modules/storage/git/storage.js
View file @
566043ec
...
...
@@ -302,19 +302,24 @@ module.exports = {
*/
async
renamed
(
page
)
{
WIKI
.
logger
.
info
(
`(STORAGE/GIT) Committing file move from [
${
page
.
localeCode
}
]
${
page
.
path
}
to [
${
page
.
destinationLocaleCode
}
]
${
page
.
destinationPath
}
...`
)
let
sourceFile
Path
=
`
${
page
.
path
}
.
${
pageHelper
.
getFileExtension
(
page
.
contentType
)}
`
let
destinationFile
Path
=
`
${
page
.
destinationPath
}
.
${
pageHelper
.
getFileExtension
(
page
.
contentType
)}
`
let
sourceFile
Name
=
`
${
page
.
path
}
.
${
pageHelper
.
getFileExtension
(
page
.
contentType
)}
`
let
destinationFile
Name
=
`
${
page
.
destinationPath
}
.
${
pageHelper
.
getFileExtension
(
page
.
contentType
)}
`
if
(
WIKI
.
config
.
lang
.
namespacing
)
{
if
(
WIKI
.
config
.
lang
.
code
!==
page
.
localeCode
)
{
sourceFile
Path
=
`
${
page
.
localeCode
}
/
${
sourceFilePath
}
`
sourceFile
Name
=
`
${
page
.
localeCode
}
/
${
sourceFileName
}
`
}
if
(
WIKI
.
config
.
lang
.
code
!==
page
.
destinationLocaleCode
)
{
destinationFile
Path
=
`
${
page
.
destinationLocaleCode
}
/
${
destinationFilePath
}
`
destinationFile
Name
=
`
${
page
.
destinationLocaleCode
}
/
${
destinationFileName
}
`
}
}
await
this
.
git
.
mv
(
`./
${
sourceFilePath
}
`
,
`./
${
destinationFilePath
}
`
)
const
sourceFilePath
=
path
.
join
(
this
.
repoPath
,
sourceFileName
)
const
destinationFilePath
=
path
.
join
(
this
.
repoPath
,
destinationFileName
)
await
fs
.
move
(
sourceFilePath
,
destinationFilePath
)
await
this
.
git
.
rm
(
`./
${
sourceFileName
}
`
)
await
this
.
git
.
add
(
`./
${
destinationFileName
}
`
)
await
this
.
git
.
commit
(
`docs: rename
${
page
.
path
}
to
${
page
.
destinationPath
}
`
,
[
sourceFilePath
,
destinationFilePath
],
{
'--author'
:
`"
${
page
.
moveAuthorName
}
<
${
page
.
moveAuthorEmail
}
>"`
})
...
...
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