@ -302,19 +302,24 @@ module.exports = {
* /
* /
async renamed ( page ) {
async renamed ( page ) {
WIKI . logger . info ( ` (STORAGE/GIT) Committing file move from [ ${ page . localeCode } ] ${ page . path } to [ ${ page . destinationLocaleCode } ] ${ page . destinationPath } ... ` )
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 sourceFile Name = ` ${ page . path } . ${ pageHelper . getFileExtension ( page . contentType ) } `
let destinationFile Path = ` ${ page . destinationPath } . ${ pageHelper . getFileExtension ( page . contentType ) } `
let destinationFile Name = ` ${ page . destinationPath } . ${ pageHelper . getFileExtension ( page . contentType ) } `
if ( WIKI . config . lang . namespacing ) {
if ( WIKI . config . lang . namespacing ) {
if ( WIKI . config . lang . code !== page . localeCode ) {
if ( WIKI . config . lang . code !== page . localeCode ) {
sourceFile Path = ` ${ page . localeCode } / ${ sourceFile Path } `
sourceFile Name = ` ${ page . localeCode } / ${ sourceFile Name } `
}
}
if ( WIKI . config . lang . code !== page . destinationLocaleCode ) {
if ( WIKI . config . lang . code !== page . destinationLocaleCode ) {
destinationFile Path = ` ${ page . destinationLocaleCode } / ${ destinationFile Path } `
destinationFile Name = ` ${ page . destinationLocaleCode } / ${ destinationFile Name } `
}
}
}
}
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 ] , {
await this . git . commit ( ` docs: rename ${ page . path } to ${ page . destinationPath } ` , [ sourceFilePath , destinationFilePath ] , {
'--author' : ` " ${ page . moveAuthorName } < ${ page . moveAuthorEmail } >" `
'--author' : ` " ${ page . moveAuthorName } < ${ page . moveAuthorEmail } >" `
} )
} )