mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Implement a no sync rule (#7216)
* implement a no sync rule * fix linting disable * fix unused imports * exclude more testing * clean up fs usage * clean up more fs usage * remove duplicate of code * fix compile errors
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as fspath from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as vscode from 'vscode';
|
||||
import * as utils from '../../../utils';
|
||||
import * as LocalizedConstants from '../../../localizedConstants';
|
||||
@@ -223,7 +222,7 @@ export class SparkConfigurationTab {
|
||||
|
||||
// 1. For local file Source check whether they existed.
|
||||
if (this._dataModel.isMainSourceFromLocal) {
|
||||
if (!fs.existsSync(this._dataModel.localFileSourcePath)) {
|
||||
if (!(await utils.exists(this._dataModel.localFileSourcePath))) {
|
||||
this._dataModel.showDialogError(LocalizedConstants.sparkJobSubmissionLocalFileNotExisted(this._dataModel.localFileSourcePath));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
import * as fs from 'fs';
|
||||
import * as fspath from 'path';
|
||||
import * as os from 'os';
|
||||
|
||||
@@ -143,7 +142,7 @@ export class SparkJobSubmissionModel {
|
||||
return Promise.reject(localize('sparkJobSubmission_localFileOrFolderNotSpecified.', 'Property localFilePath or hdfsFolderPath is not specified. '));
|
||||
}
|
||||
|
||||
if (!fs.existsSync(localFilePath)) {
|
||||
if (!(await utils.exists(localFilePath))) {
|
||||
return Promise.reject(LocalizedConstants.sparkJobSubmissionLocalFileNotExisted(localFilePath));
|
||||
}
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ export function getTemplatePath(extensionPath: string, templateName: string): st
|
||||
}
|
||||
export function shellWhichResolving(cmd: string): Promise<string> {
|
||||
return new Promise<string>(resolve => {
|
||||
which(cmd, (err, foundPath) => {
|
||||
which(cmd, async (err, foundPath) => {
|
||||
if (err) {
|
||||
resolve(undefined);
|
||||
} else {
|
||||
// NOTE: Using realpath b/c some system installs are symlinked from */bin
|
||||
resolve(fs.realpathSync(foundPath));
|
||||
resolve(await fs.promises.realpath(foundPath));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user