Update scripts

This commit is contained in:
freearhey 2023-09-15 18:40:35 +03:00
parent 8a83f23243
commit f1d2add19a
98 changed files with 2423 additions and 1499 deletions

31
scripts/core/file.ts Normal file
View file

@ -0,0 +1,31 @@
import * as path from 'path'
export class File {
filepath: string
content: string
constructor(filepath: string, content?: string) {
this.filepath = filepath
this.content = content || ''
}
getFilename() {
return path.parse(this.filepath).name
}
dirname() {
return path.dirname(this.filepath)
}
basename() {
return path.basename(this.filepath)
}
append(data: string) {
this.content = this.content + data
}
extension() {
return this.filepath.split('.').pop()
}
}