Skip to content

Commit

Permalink
Merge pull request #8 from lsst-sqre/tickets/DM-29432
Browse files Browse the repository at this point in the history
DM-29432: Ensure config path is absolute
  • Loading branch information
jonathansick authored Apr 5, 2021
2 parents b71c0cb + b1cfc59 commit ff9598e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ const readYamlConfig = (configPath, schemaPath) => {
};

const readPublicYamlConfig = () => {
const configPath = path.join(
process.cwd(),
process.env.SQUAREONE_CONFIG_PATH || 'squareone.config.yaml'
);
const p = process.env.SQUAREONE_CONFIG_PATH || 'squareone.config.yaml';
const configPath = path.isAbsolute(p) ? p : path.join(process.cwd(), p);
console.log(`Public config path: ${configPath}`);

const schemaPath = path.join(__dirname, 'squareone.config.schema.json');
Expand All @@ -38,10 +36,8 @@ const readPublicYamlConfig = () => {
};

const readServerYamlConfig = () => {
const configPath = path.join(
process.cwd(),
process.env.SQUAREONE_CONFIG_PATH || 'squareone.serverconfig.yaml'
);
const p = process.env.SQUAREONE_CONFIG_PATH || 'squareone.serverconfig.yaml';
const configPath = path.isAbsolute(p) ? p : path.join(process.cwd(), p);
console.log(`Server config path: ${configPath}`);

const schemaPath = path.join(__dirname, 'squareone.serverconfig.schema.json');
Expand Down

0 comments on commit ff9598e

Please sign in to comment.