Skip to content

Commit

Permalink
fix: windows compatible absolute paths for staticDir
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRibbens committed Aug 18, 2021
1 parent cb422bb commit b21316b
Show file tree
Hide file tree
Showing 3 changed files with 595 additions and 486 deletions.
2 changes: 1 addition & 1 deletion src/collections/operations/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function create(this: Payload, incomingArgs: Arguments): Promise<Document>
let staticPath = staticDir;

if (staticDir.indexOf('/') !== 0) {
staticPath = path.join(config.paths.configDir, staticDir);
staticPath = path.resolve(config.paths.configDir, staticDir);
}

if (!disableLocalStorage) {
Expand Down
2 changes: 1 addition & 1 deletion src/collections/operations/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async function update(incomingArgs: Arguments): Promise<Document> {
let staticPath = staticDir;

if (staticDir.indexOf('/') !== 0) {
staticPath = path.join(config.paths.configDir, staticDir);
staticPath = path.resolve(config.paths.configDir, staticDir);
}

const file = ((req.files && req.files.file) ? req.files.file : req.file) as UploadedFile;
Expand Down
Loading

0 comments on commit b21316b

Please sign in to comment.