Skip to content

Commit

Permalink
Removing obsolete functions and files from the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
brnovasco committed Feb 19, 2024
1 parent 2ddb9c1 commit 2e0e0d8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 97 deletions.
2 changes: 0 additions & 2 deletions src/server/api/root.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createTRPCRouter } from '~/server/api/trpc';

import { filesystemRouter } from './routers/filesystem';
import { remoteFilesRouter } from './routers/remote-files';
import { remoteJobRouter } from './routers/remote-job';
import { remoteProcessRouter } from './routers/remote-node-process-router';
import { sshRouter } from './routers/ssh';
Expand All @@ -16,7 +15,6 @@ export const appRouter = createTRPCRouter({
ssh: sshRouter,
filesystem: filesystemRouter,
remotejob: remoteJobRouter,
remotefiles: remoteFilesRouter,
workspaceDbState: workspaceDbStateRouter,
remoteProcess: remoteProcessRouter,
});
Expand Down
26 changes: 0 additions & 26 deletions src/server/api/routers/remote-files.ts

This file was deleted.

69 changes: 0 additions & 69 deletions src/server/remote-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,72 +434,3 @@ export function removePublicKeyByComment(
conn.connect(sshOptions);
});
}

export function removeRemoteFiles(
privateKey: string,
passphrase: string,
username: string,
host: string,
path: string,
): Promise<string | undefined> {
return new Promise((resolve) => {
const sshOptions: Config = {
debug: console.log,
host,
port: 22,
username,
privateKey: privateKey,
passphrase: passphrase,
};
const conn = new NodeSSH();
conn
.connect(sshOptions)
.then(() => {
executeCommand(`rm -rf ${path}`)
.then(() => {
resolve('success');
})
.catch((err) => {
console.log(err);
});
})
.catch((err) => {
console.log(err);
});
});
}

export function readRemoteFile(
privateKey: string,
passphrase: string,
username: string,
host: string,
path: string,
): Promise<string | undefined> {
return new Promise((resolve) => {
const sshOptions: Config = {
debug: console.log,
host,
port: 22,
username,
privateKey: privateKey,
passphrase: passphrase,
};
const conn = new NodeSSH();
conn
.connect(sshOptions)
.then(() => {
console.log('readRemoteFile: connected and trying to read', path);
executeCommand(`cat ${path}`)
.then((output) => {
resolve(output);
})
.catch((err) => {
console.log(err);
});
})
.catch((err) => {
console.log(err);
});
});
}

0 comments on commit 2e0e0d8

Please sign in to comment.