-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f844702
commit b8d88d7
Showing
7 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "Hakit", | ||
"version": "1.0.29", | ||
"version": "1.0.30", | ||
"slug": "hakit", | ||
"init": false, | ||
"ingress": true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Request, Response } from 'express'; | ||
import { join } from 'path'; | ||
import { existsSync } from 'fs'; | ||
import { rm } from 'fs/promises' | ||
import { APP_DIRECTORY } from '../constants.js'; | ||
import { translateError } from '../helpers/index.js'; | ||
|
||
|
||
export async function removeBuild(_req: Request, res: Response) { | ||
const buildDir = join(APP_DIRECTORY, 'app', '.next'); | ||
const nextJsBuilt = existsSync(buildDir); | ||
if (nextJsBuilt) { | ||
// remove the directory .next | ||
try { | ||
await rm(buildDir, { recursive: true, force: true }); | ||
console.log('.next directory removed successfully'); | ||
return res.status(200).send('Directory removed successfully'); | ||
} catch (error) { | ||
console.error('Error removing build directory:', translateError(error)); | ||
return res.status(500).send('Error removing build directory'); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters