make the filepath consistent between Packwiz.location
and Packwiz.index.location
Some checks failed
Actions / Build and Push Documentation (push) Has been cancelled
Some checks failed
Actions / Build and Push Documentation (push) Has been cancelled
This commit is contained in:
parent
6f25c57371
commit
e84437d92c
2 changed files with 4 additions and 2 deletions
|
@ -16,7 +16,7 @@ See the [documentation](./docs) for more information.
|
|||
> import { parsePackwiz } from "packwizjs";
|
||||
> const packwizFile = await parsePackwiz("./packwiz/pack.toml")
|
||||
Packwiz {
|
||||
location: Resource { path: './packwiz/pack.toml' },
|
||||
location: Resource { path: 'packwiz/pack.toml' },
|
||||
index: { // The index file is automatically parsed alongside the pack.toml file
|
||||
location: Resource { path: 'packwiz/index.toml' },
|
||||
hash: '6ce48b376540c840b9c2c1eaedbdf64f3b0e1203888ea644fc5d8fff66377c18',
|
||||
|
|
|
@ -191,7 +191,9 @@ export class Packwiz {
|
|||
* @returns The parsed file as a structured class.
|
||||
*/
|
||||
export async function parsePackwiz(filePath: string): Promise<Packwiz> {
|
||||
const packwizFile = new Resource(filePath);
|
||||
let packwizFile = new Resource(filePath);
|
||||
// make the actual path consistent with the index file
|
||||
packwizFile = packwizFile.parent.join(packwizFile.name);
|
||||
const parsedPackwizFile = toml.parse(await packwizFile.fetchContents());
|
||||
|
||||
const indexFile = packwizFile.parent.join(parsedPackwizFile.index.file);
|
||||
|
|
Reference in a new issue