Skip to content

Commit

Permalink
feat: upgrade fs import
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Nov 15, 2024
1 parent 0b2adfb commit d59d0f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/core/lib/actions/fs/createReadStream/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Dependencies
import fs from "ssh2-fs";
import * as fs from "ssh2-fs";
import exec from "ssh2-exec/promises";
import utils from "@nikitajs/core/utils";
// Schema
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/actions/fs/createWriteStream/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Dependencies
import fs from "ssh2-fs";
import * as fs from "ssh2-fs";
import exec from "ssh2-exec/promises";
import utils from "@nikitajs/core/utils";
// Schema
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/plugins/metadata/tmpdir.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os from "node:os";
import fs from "ssh2-fs";
import * as fs from "ssh2-fs";
import exec from "ssh2-exec/promises";
import { is_object_literal } from "mixme";
import utils from "@nikitajs/core/utils";
Expand Down
7 changes: 3 additions & 4 deletions packages/core/test/actions/fs/readFile.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

import fs from 'ssh2-fs'
import nikita from '@nikitajs/core'
import test from '../../test.coffee'
import mochaThey from 'mocha-they'
Expand Down Expand Up @@ -49,7 +48,7 @@ describe 'actions.fs.readFile', ->
encoding: 'ascii'
trim: true
.should.be.finally.containEql data: 'hello'

describe 'config `format`', ->

they 'as udf', ({ssh}) ->
Expand Down Expand Up @@ -80,9 +79,9 @@ describe 'actions.fs.readFile', ->
target: "{{parent.metadata.tmpdir}}/a_file"
format: 'json'
data.should.eql key: 'value'

describe 'error', ->

they 'forward errors from createReadStream', ({ssh}) ->
nikita
$ssh: ssh
Expand Down

0 comments on commit d59d0f9

Please sign in to comment.