privacy.sexy icon indicating copy to clipboard operation
privacy.sexy copied to clipboard

[BUG]: Just a small bug when you want to change automatic updates to manual updates

Open plantindesk opened this issue 1 year ago • 1 comments

Problem

--- Disable Visual Studio Code automatic updates in favor of manual updates 
manual : The term 'manual' is not recognized as the name of a cmdlet, function, script file, or operable program.       Check the spelling of the name, or if a path was included, verify that the path is correct and try again.               At line:1 char:42                                                                                                       + $settingKey='update.mode'; $settingValue=manual; $jsonFilePath = "$($ ...                                             +                                          ~~~~~~                                                                           + CategoryInfo          : ObjectNotFound: (manual:String) [], CommandNotFoundException                                  + FullyQualifiedErrorId : CommandNotFoundException 

Solution

  • The error is occurring because the value "manual" is being interpreted as a command or function, not as a string.
  • You need to enclose the value "manual" in single quotes to treat it as a string.
  • Before
:: Disable Visual Studio Code automatic updates in favor of manual updates
echo --- Disable Visual Studio Code automatic updates in favor of manual updates
PowerShell -ExecutionPolicy Unrestricted -Command "$settingKey='update.mode'; $settingValue=manual; $jsonFilePath = "^""$($env:APPDATA)\Code\User\settings.json"^""; if (!(Test-Path $jsonFilePath -PathType Leaf)) {; Write-Host "^""Skipping, no updates. Settings file was not at `"^""$jsonFilePath`"^""."^""; exit 0; }; try {; $fileContent = Get-Content $jsonFilePath -ErrorAction Stop; } catch {; throw "^""Error, failed to read the settings file: `"^""$jsonFilePath`"^"". Error: $_"^""; }; if ([string]::IsNullOrWhiteSpace($fileContent)) {; Write-Host "^""Settings file is empty. Treating it as default empty JSON object."^""; $fileContent = "^""{}"^""; }; try {; $json = $fileContent | ConvertFrom-Json; } catch {; throw "^""Error, invalid JSON format in the settings file: `"^""$jsonFilePath`"^"". Error: $_"^""; }; $existingValue = $json.$settingKey; if ($existingValue -eq $settingValue) {; Write-Host "^""Skipping, `"^""$settingKey`"^"" is already configured as `"^""$settingValue`"^""."^""; exit 0; }; $json | Add-Member -Type NoteProperty -Name $settingKey -Value $settingValue -Force; $json | ConvertTo-Json | Set-Content $jsonFilePath; Write-Host "^""Successfully applied the setting to the file: `"^""$jsonFilePath`"^""."^"""
  • After:
echo --- Disable Visual Studio Code automatic updates in favor of manual updates
PowerShell -ExecutionPolicy Unrestricted -Command "$settingKey='update.mode'; $settingValue='manual'; $jsonFilePath = "^""$($env:APPDATA)\Code\User\settings.json"^""; if (!(Test-Path $jsonFilePath -PathType Leaf)) {; Write-Host "^""Skipping, no updates. Settings file was not at `"^""$jsonFilePath`"^""."^""; exit 0; }; try {; $fileContent = Get-Content $jsonFilePath -ErrorAction Stop; } catch {; throw "^""Error, failed to read the settings file: `"^""$jsonFilePath`"^"". Error: $_"^""; }; if ([string]::IsNullOrWhiteSpace($fileContent)) {; Write-Host "^""Settings file is empty. Treating it as default empty JSON object."^""; $fileContent = "^""{}"^""; }; try {; $json = $fileContent | ConvertFrom-Json; } catch {; throw "^""Error, invalid JSON format in the settings file: `"^""$jsonFilePath`"^"". Error: $_"^""; }; $existingValue = $json.$settingKey; if ($existingValue -eq $settingValue) {; Write-Host "^""Skipping, `"^""$settingKey`"^"" is already configured as `"^""$settingValue`"^""."^""; exit 0; }; $json | Add-Member -Type NoteProperty -Name $settingKey -Value $settingValue -Force; $json | ConvertTo-Json | Set-Content $jsonFilePath; Write-Host "^""Successfully applied the setting to the file: `"^""$jsonFilePath`"^""."^"""

plantindesk avatar Jan 21 '24 07:01 plantindesk

Thank you for the clear report. This will be fixed in a patch release later on once I realize 0.13.0.

undergroundwires avatar Feb 10 '24 17:02 undergroundwires

image

You can also try adding meta data such as 'keywords', 'og:url', and other tags for SEO so that more users will get inspired and attracted by it

plantindesk avatar Feb 21 '24 17:02 plantindesk

The bug is fixed as part of 0.13.1 🚀. Thank you again @plantindesk.

Regarding meta tags, does keywords and og:url really add/contribute to anything? I don't know much about these tags/SEO.

Closing this issue as the main problem is resolved.

undergroundwires avatar Mar 23 '24 10:03 undergroundwires

example of techradar

Example of techradar

When a user shares a link on apps like WhatsApp, the app automatically embeds the linked page's metadata, including images and descriptions, which are defined by specific meta tags such as og:url and og:description. However, for search engines like Google, having relevant keywords in the meta tag name="keywords" is still important for indexing and ranking purposes. It's essential to optimize both the content and metadata of web pages to ensure visibility and engagement across different platforms and search results.

plantindesk avatar Mar 25 '24 06:03 plantindesk