mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2026-04-28 11:17:38 +02:00
added bit more advanced file existance checking, removed vhosts in favor or routes
This commit is contained in:
+3
-3
@@ -46,7 +46,7 @@ import fs from 'fs'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import logger from '../utils/logger'
|
||||
|
||||
import constants from '../constants.json'
|
||||
import { paths } from './files'
|
||||
import { Request } from '../types/basicTypes'
|
||||
|
||||
interface URLFormatOptions {
|
||||
@@ -115,7 +115,7 @@ function ReadDir(path: string, listHidden?: boolean): Array<string> {
|
||||
}
|
||||
}
|
||||
|
||||
function ReadJSON(name: string): any {
|
||||
function ReadJSON<T = any>(name: string): T {
|
||||
try {
|
||||
return JSON.parse(ReadFile(name))
|
||||
} catch (err) {
|
||||
@@ -329,7 +329,7 @@ function getGitRevision(dir: string): string {
|
||||
}
|
||||
|
||||
function getScriptVersion(): string {
|
||||
const scriptContent = ReadFile(constants.moodleTestUserscriptPath)
|
||||
const scriptContent = ReadFile(paths.moodleTestUserscriptPath)
|
||||
|
||||
let temp: string | string[] = scriptContent.split('\n').find((x) => {
|
||||
return x.includes('@version')
|
||||
|
||||
Reference in New Issue
Block a user