chore: Improve formatting
parent
673db7a2e7
commit
8d105f07bc
|
@ -1,6 +1,6 @@
|
||||||
interface File {
|
interface File {
|
||||||
path: string;
|
path: string;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default File;
|
export default File;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import File from './file';
|
import File from "./file";
|
||||||
|
|
||||||
interface Pack {
|
interface Pack {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
@ -2,10 +2,10 @@ import Pack from "../interfaces/pack";
|
||||||
import File from "../interfaces/file";
|
import File from "../interfaces/file";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import * as fsWalk from "@nodelib/fs.walk";
|
import * as fsWalk from "@nodelib/fs.walk";
|
||||||
import os from 'os';
|
import os from "os";
|
||||||
import { resolve } from "path/posix";
|
import { resolve } from "path/posix";
|
||||||
|
|
||||||
const PACK_BASE_PATH =`${os.homedir()}/beatpacks`;
|
const PACK_BASE_PATH = `${os.homedir()}/beatpacks`;
|
||||||
|
|
||||||
export default class PackService {
|
export default class PackService {
|
||||||
private static packList: Pack[] = [];
|
private static packList: Pack[] = [];
|
||||||
|
@ -15,7 +15,7 @@ export default class PackService {
|
||||||
public static getInitialList = async (): Promise<void> => {
|
public static getInitialList = async (): Promise<void> => {
|
||||||
let packs = await fs.readdirSync(PACK_BASE_PATH, { withFileTypes: true });
|
let packs = await fs.readdirSync(PACK_BASE_PATH, { withFileTypes: true });
|
||||||
packs = packs.filter((pack) => pack.isDirectory());
|
packs = packs.filter((pack) => pack.isDirectory());
|
||||||
|
|
||||||
PackService.packList = await Promise.all(
|
PackService.packList = await Promise.all(
|
||||||
packs.map((pack) => PackService.getPackInfo(pack.name))
|
packs.map((pack) => PackService.getPackInfo(pack.name))
|
||||||
);
|
);
|
||||||
|
@ -38,7 +38,7 @@ export default class PackService {
|
||||||
packFiles.map(async (file) => {
|
packFiles.map(async (file) => {
|
||||||
files.push({
|
files.push({
|
||||||
path: file.path,
|
path: file.path,
|
||||||
name: file.name
|
name: file.name,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (file.name === "bpm.txt") {
|
if (file.name === "bpm.txt") {
|
||||||
|
|
Loading…
Reference in New Issue