Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 1.3] [BUG] Plugin helpers fix related to fs promises module #2487

Merged
merged 1 commit into from
Oct 3, 2022
Merged
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
[BUG] Plugin helpers fix related to fs promises module (#2486)
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:
#2485

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 945cfe6)
  • Loading branch information
kavilla authored and github-actions[bot] committed Oct 3, 2022
commit ae8faaba5f3c4d783d2b2ca6dc4afdbce77e0dff
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

* Plugin helpers fix related to fs promises module ([#2486](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2486))

### 🚞 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