Skip to content

Commit

Permalink
createModule working in Windows (#245)
Browse files Browse the repository at this point in the history
This is the same change as in #243 but for modules.

This gets the createModule tests passing. In theory it also was preventing windows users from creating new modules
(though we currently don't allow anybody to create modules anyways).
With this all of the frontend jest tests are passing!

J=SLAP-2790
TEST=auto
  • Loading branch information
oshi97 authored Jun 27, 2023
1 parent 6de7c76 commit a0f33ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/studio/src/store/createModuleAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function getCreateModuleAction(
function throwIfInvalidFilepath(filepath: string) {
const modulesFolder = get().studioConfig.paths.modules;
const moduleName = path.basename(filepath, ".tsx");
if (!path.isAbsolute(filepath) || !filepath.startsWith(modulesFolder)) {
if (!filepath.startsWith(modulesFolder)) {
throw new Error(
`Error creating module: modulePath is invalid: "${path.relative(
modulesFolder,
Expand Down

0 comments on commit a0f33ed

Please sign in to comment.