Skip to content

Commit

Permalink
[BUG] Plugin helpers fix related to fs promises module
Browse files Browse the repository at this point in the history
In Node v10, there was no dedicated module for fs/promises.
Causing the plugin helpers to fail while building out plugins.

Solved by importing promises from fs then using the desired
methods.

Issue Resolved:
opensearch-project#2485

Signed-off-by: Kawika Avilla <[email protected]>
  • Loading branch information
kavilla committed Oct 3, 2022
1 parent 04ff11c commit 4cc430a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### 🐛 Bug Fixes

* []

### 🚞 Infrastructure

### 📝 Documentation
Expand Down
4 changes: 3 additions & 1 deletion packages/osd-plugin-helpers/src/tasks/update_versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
*/

// @ts-ignore
import { readFile, writeFile } from 'fs/promises';
import { promises } from 'fs';
import path from 'path';
import { createFailError } from '@osd/dev-utils';
import { FileUpdateContext, ObjectUpdateContext, VersionContext } from '../contexts';

const { readFile, writeFile } = promises;

export async function updateVersions({
log,
sourceDir,
Expand Down

0 comments on commit 4cc430a

Please sign in to comment.