@zhangfengshun/dsh-remote-ssh 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +6 -6
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -12,8 +12,9 @@ import z from "schemastery";
12
12
  import { defineTool } from "@deepseek-ai/dsh-tools";
13
13
  import { settingsNamespace } from "@deepseek-ai/dsh-settings";
14
14
  import { mkdir, rm, writeFile, readFile, opendir, stat, open, rename, readdir } from "node:fs/promises";
15
+ import { existsSync, readFileSync } from "node:fs";
15
16
  import { homedir } from "node:os";
16
- import { join } from "node:path";
17
+ import { join, dirname } from "node:path";
17
18
 
18
19
  /** Plugin identity for cordis.yml rows. */
19
20
  const name = "@zhangfengshun/dsh-remote-ssh";
@@ -1402,10 +1403,9 @@ function apply(ctx, config) {
1402
1403
  function readRemoteInfoSync(mirrorCwd) {
1403
1404
  if (!mirrorCwd) return null;
1404
1405
  try {
1405
- const fs2 = require("fs");
1406
- const jsonPath = require("path").join(mirrorCwd, ".remote-ssh.json");
1407
- if (fs2.existsSync(jsonPath)) {
1408
- return JSON.parse(fs2.readFileSync(jsonPath, "utf8"));
1406
+ const jsonPath = join(mirrorCwd, ".remote-ssh.json");
1407
+ if (existsSync(jsonPath)) {
1408
+ return JSON.parse(readFileSync(jsonPath, "utf8"));
1409
1409
  }
1410
1410
  } catch (e) {}
1411
1411
  return null;
@@ -1480,7 +1480,7 @@ function apply(ctx, config) {
1480
1480
  async function localWriteFile(path, content) {
1481
1481
  const tmp = path + ".dsh-rssh-tmp-" + process.pid;
1482
1482
  try {
1483
- await mkdir(require("path").dirname(path), { recursive: true });
1483
+ await mkdir(dirname(path), { recursive: true });
1484
1484
  await writeFile(tmp, content, "utf8");
1485
1485
  await rename(tmp, path);
1486
1486
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhangfengshun/dsh-remote-ssh",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "DSH web plugin: VSCode Remote-SSH-like remote development (SSH to supercomputers/servers, remote workspace, file explorer, integrated terminal), integrated with dsh-better-sidebar and DSH settings.",
5
5
  "keywords": [
6
6
  "dsh",