chore: initial commit
This commit is contained in:
Executable
+17
@@ -0,0 +1,17 @@
|
||||
import * as path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
import * as fs from "node:fs";
|
||||
|
||||
export function get_project_root_path() {
|
||||
// @ts-ignore
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
return path.resolve(__dirname, '..')
|
||||
}
|
||||
|
||||
|
||||
export function get_path_dir_list(dir: string): string[] {
|
||||
return fs.readdirSync(dir, { withFileTypes: true })
|
||||
.filter(item => item.isDirectory())
|
||||
.map(item => path.join(dir, item.name));
|
||||
}
|
||||
Reference in New Issue
Block a user