Skip to content

Commit

Permalink
slight code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lokesh-couchbase committed Oct 11, 2023
1 parent 42cf402 commit 887c62a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 16 deletions.
11 changes: 0 additions & 11 deletions src/handlers/handleCLIDownloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class DependenciesDownloader {
this.setToolActive(ToolStatus.AVAILABLE, shellPath, shell);
}
const cbImport: ToolSpec | undefined = downloads.get(this.TOOL_IMPORT_EXPORT);
console.log("cbImport", cbImport);
if (cbImport === undefined){
return;
}
Expand All @@ -134,7 +133,6 @@ class DependenciesDownloader {
this.downloadAndUnzip(cbImportDir, cbImport);
} else {
logger.info("CB Import/Export is already installed");
console.log("import/export check");
this.setToolActive(ToolStatus.AVAILABLE, cbImportDir, cbImport);
}

Expand Down Expand Up @@ -168,9 +166,7 @@ class DependenciesDownloader {
res.data.pipe(writeStream);
writeStream.on("finish", () => {
writeStream.close();
console.log("Download Completed!");
decompress(localFilePath, targetDir).then(()=>{
console.log("Unzipped Successfully");
fs.unlinkSync(localFilePath);
makeFilesExecutable(targetDir);
//this.runFile(targetDir);
Expand Down Expand Up @@ -203,13 +199,6 @@ class DependenciesDownloader {
public runFile(targetDir:string) {
const scriptPath = path.join(targetDir, 'cbsh');
vscode.window.createTerminal("CBShell", `${scriptPath}`);
// child_process.exec(`${scriptPath}`, (error, stdout,stderr) => {
// console.log(`stdout: ${stdout}`);
// console.log(`stderr: ${stderr}`);
// if (error !== null) {
// console.log(`exec error: ${error}`);
// }
// });
}
}

Expand Down
1 change: 0 additions & 1 deletion src/pages/overviewCluster/overviewCluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export async function fetchClusterOverview(node: ClusterConnectionNode, refresh:
} catch (e) {
logger.debug("Cluster overview webview may have been already disposed: " + e);
}

}

currentPanel.onDidDispose(() => {
Expand Down
2 changes: 0 additions & 2 deletions src/tools/CBExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ export class CBExport {
cmd.push("-v");
}

console.log(cmd[0]);
const terminal = vscode.window.createTerminal("CBExport",);
let text = cmd.join(" ");
console.log(text);
terminal.sendText(text);
terminal.show();

Expand Down
3 changes: 2 additions & 1 deletion src/util/DependencyDownloaderUtils/fileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as fs from 'fs';
import * as path from 'path';
import * as childProcess from 'child_process';
import OSUtil from './OSUtils';
import { logger } from '../../logger/logger';

export const createFolder = (folderName: string) => {
try {
Expand Down Expand Up @@ -91,7 +92,7 @@ export function makeFilesExecutable(directory: string): void {
fs.chmodSync(filePath, '755');
}
} catch (error) {
console.log(`Could not set executable flag on file: ${filePath}`);
logger.error(`Could not set executable flag on file: ${filePath}`);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/webViews/tools/dataExport.webview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export const dataExportWebview = async (buckets: string[]): Promise<string> => {
function submitForm(event) {
event.preventDefault(); // Prevent the form from submitting in the traditional way
document.getElementById("validation-error").innerHTML = "";
// Gather data from form fields
const bucket = document.getElementById('bucket').value;
const scopes = Array.from(document.getElementById('scopes').selectedOptions).map(option => option.value);
Expand Down

0 comments on commit 887c62a

Please sign in to comment.