Improve secretStorage usage and pipx installation
- Add await keyword to secretStorage.store call in extension.ts. - Set statusBarItem.command to undefined instead of an empty string. - Force pipx installation in install.py by adding --force flag.
This commit is contained in:
parent
88b16d53c3
commit
a9fa1c7abb
@ -177,7 +177,7 @@ function activate(context: vscode.ExtensionContext) {
|
|||||||
const versionOld = await secretStorage.get("devchat_version_old");
|
const versionOld = await secretStorage.get("devchat_version_old");
|
||||||
const versionNew = extensionVersion;
|
const versionNew = extensionVersion;
|
||||||
const versionChanged = versionOld !== versionNew;
|
const versionChanged = versionOld !== versionNew;
|
||||||
secretStorage.store("devchat_version_old", versionNew!);
|
await secretStorage.store("devchat_version_old", versionNew!);
|
||||||
|
|
||||||
// status item has three status type
|
// status item has three status type
|
||||||
// 1. not in a folder
|
// 1. not in a folder
|
||||||
@ -217,7 +217,7 @@ function activate(context: vscode.ExtensionContext) {
|
|||||||
if (devchatStatus !== 'ready') {
|
if (devchatStatus !== 'ready') {
|
||||||
statusBarItem.text = `$(warning)DevChat`;
|
statusBarItem.text = `$(warning)DevChat`;
|
||||||
statusBarItem.tooltip = `${devchatStatus}`;
|
statusBarItem.tooltip = `${devchatStatus}`;
|
||||||
statusBarItem.command = '';
|
statusBarItem.command = undefined;
|
||||||
// set statusBarItem warning color
|
// set statusBarItem warning color
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ def check_pipx_installed():
|
|||||||
def install_pipx():
|
def install_pipx():
|
||||||
print("Installing pipx...")
|
print("Installing pipx...")
|
||||||
try:
|
try:
|
||||||
subprocess.run(["python3", "-m", "pip", "install", "pipx"], check=True)
|
subprocess.run(["python3", "-m", "pip", "install", "pipx", "--force"], check=True)
|
||||||
print("pipx installed successfully.")
|
print("pipx installed successfully.")
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print("Error installing pipx:", e, file=sys.stderr)
|
print("Error installing pipx:", e, file=sys.stderr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user