Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/templates/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { version } from '../../package.json';
import fs from 'fs';

const { version } = JSON.parse(fs.readFileSync('package.json', 'utf8'));

export const ozVersion = () => version;

Expand Down
2 changes: 1 addition & 1 deletion scripts/get-contracts-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function getContractsMetadata(
// definitions with minimal IO operations.
const metadata = Object.fromEntries(
artifacts.flatMap(artifact => {
const { output: solcOutput } = JSON.parse(fs.readFileSync(path.resolve(import.meta.dirname, '..', artifact)));
const { output: solcOutput } = JSON.parse(fs.readFileSync(artifact));
return Object.keys(solcOutput?.contracts ?? {})
.filter(
source =>
Expand Down
3 changes: 1 addition & 2 deletions scripts/update-docs-branch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import proc from 'child_process';
import fs from 'fs';
import path from 'path';

const read = cmd => proc.execSync(cmd, { encoding: 'utf8' }).trim();
const run = cmd => {
Expand All @@ -24,7 +23,7 @@ if (!match) {
process.exit(1);
}

const pkgVersion = JSON.parse(fs.readFileSync(path.resolve(import.meta.dirname, '../package.json'), 'utf8')).version;
const pkgVersion = JSON.parse(fs.readFileSync('package.json', 'utf8')).version;

if (pkgVersion.includes('-') && !pkgVersion.includes('.0.0-')) {
console.error('Refusing to update docs: non-major prerelease detected');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would:
a. rollback changes in scripts/update-docs-branch.js & use a modified copy in community
b. or parametrize this script enough to be used in community (branch, ..)

Expand Down
Loading