Skip to content

Commit

Permalink
Merge pull request #986 from wherelse/fix-folderpath
Browse files Browse the repository at this point in the history
fix: preview folder path
  • Loading branch information
EryouHao authored May 17, 2022
2 parents 1034e40 + 4d842d1 commit 31e14d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default class App {
// Site folder exists
if (fse.pathExistsSync(this.appDir)) {
// Check if the `images`, `config`, 'output', `post-images`, 'posts', 'themes', 'static' folder exists, if it does not exist, copy it from default-files
['images', 'config', 'output', 'post-images', 'posts', 'themes', 'static'].forEach((folder: string) => {
['images', 'config', 'post-images', 'posts', 'themes', 'static'].forEach((folder: string) => {
const folderPath = path.join(this.appDir, folder)
if (!fse.pathExistsSync(folderPath)) {
fse.copySync(
Expand All @@ -235,7 +235,7 @@ export default class App {
this.checkTheme('paper')

// move output/favicon.ico to Gridea/favicon.ico
const outputFavicon = path.join(this.appDir, 'output', 'favicon.ico')
const outputFavicon = path.join(this.buildDir, 'favicon.ico')
const sourceFavicon = path.join(this.appDir, 'favicon.ico')
const existFaviconOutput = fse.pathExistsSync(outputFavicon)
const existFaviconSource = fse.pathExistsSync(sourceFavicon)
Expand Down Expand Up @@ -288,8 +288,8 @@ export default class App {
const routesStack = routers.stack
routesStack.forEach(removeMiddleware)
}
this.previewServer.use(express.static(`${this.appDir}/output`))
console.log(`Preview server: Static dir change to ${this.appDir}/output`)
this.previewServer.use(express.static(`${this.buildDir}`))
console.log(`Preview server: Static dir change to ${this.buildDir}`)
}

private initEvents(): void {
Expand Down
2 changes: 1 addition & 1 deletion src/server/plugins/deploys/sftp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default class SftpDeploy extends Model {
connectConfig.password = setting.password
}

const localPath = normalizePath(path.join(this.appDir, 'output'))
const localPath = normalizePath(path.join(this.buildDir))
const remotePath = normalizePath(path.join(setting.remotePath))

try {
Expand Down
2 changes: 1 addition & 1 deletion src/server/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class Renderer extends Model {
async loadConfig() {
this.themePath = urlJoin(this.appDir, 'themes', this.db.themeConfig.themeName)

fse.ensureDirSync(urlJoin(this.appDir, 'output'))
fse.ensureDirSync(urlJoin(this.outputDir))
}

/**
Expand Down

0 comments on commit 31e14d5

Please sign in to comment.