Skip to content

Commit

Permalink
fix: 🐛 Sites save configuration path resolution (#64)
Browse files Browse the repository at this point in the history
## Why?

Save configuration revision

## How?

- Fix configuration template path

## Tickets?

-
[PLAT-1728](https://linear.app/fleekxyz/issue/PLAT-1728/save-configuration-paths-for-js-and-ts)
- 

## Contribution checklist?

- [ ] The commit messages are detailed
- [ ] The `build` command runs locally
- [ ] Assets or static content are linked and stored in the project
- [ ] You have manually tested
- [ ] You have provided tests

## Security checklist?

- [ ] Sensitive data has been identified and is being protected properly
- [ ] Injection has been prevented (parameterized queries, no eval or
system calls)

## Preview?

Optionally, provide the preview url here

---------

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
heldrida and actions-user authored Nov 4, 2024
1 parent 33a4ba6 commit 9a67c12
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/utils/configuration/saveConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,22 @@ export type SaveConfigurationArgs = {

type ConfigFilePath = string;

const DEV_SRC_UTILS_PATH = '/src/utils';
const basePath = path.dirname(__filename).includes(DEV_SRC_UTILS_PATH)
? '../..'
: '';

const filePathForTypescriptConfig = path.resolve(
path.dirname(__filename),
'../../templates/sites/config',
basePath,
'templates/sites/config',
getConfigTemplateByTypeName('Typescript'),
);

const filePathForJavascriptConfig = path.resolve(
path.dirname(__filename),
'../../templates/sites/config',
basePath,
'templates/sites/config',
getConfigTemplateByTypeName('Javascript'),
);

Expand Down

0 comments on commit 9a67c12

Please sign in to comment.