File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ export const check_for_updates_command = (
1717 )
1818
1919 if ( action === t ( 'command.check-for-updates-command.action.update' ) ) {
20- if ( prompt_view_provider . update_info . latest_version_sha ) {
20+ if ( prompt_view_provider . update_info . latest_version_tag ) {
2121 update_extension ( {
22- commit_sha : prompt_view_provider . update_info . latest_version_sha
22+ tag_name : prompt_view_provider . update_info . latest_version_tag
2323 } )
2424 }
2525 }
Original file line number Diff line number Diff line change @@ -113,7 +113,6 @@ export const install_specific_version_command = () => {
113113 label : version ,
114114 description,
115115 tag : tag . name ,
116- sha : tag . commit ?. sha ,
117116 buttons : [
118117 {
119118 iconPath : new vscode . ThemeIcon ( 'globe' ) ,
@@ -126,7 +125,7 @@ export const install_specific_version_command = () => {
126125 } )
127126
128127 const quick_pick = vscode . window . createQuickPick <
129- vscode . QuickPickItem & { tag : string ; sha ?: string }
128+ vscode . QuickPickItem & { tag : string }
130129 > ( )
131130 quick_pick . title = t ( 'command.install-specific-version-command.title' )
132131 quick_pick . placeholder = t (
@@ -159,9 +158,9 @@ export const install_specific_version_command = () => {
159158
160159 quick_pick . onDidAccept ( ( ) => {
161160 const selected = quick_pick . selectedItems [ 0 ]
162- if ( selected && selected . sha ) {
161+ if ( selected && selected . tag ) {
163162 quick_pick . hide ( )
164- update_extension ( { commit_sha : selected . sha } )
163+ update_extension ( { tag_name : selected . tag } )
165164 }
166165 } )
167166
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export const check_for_updates = async (
5656 return {
5757 is_available : true ,
5858 latest_version,
59- latest_version_sha : vscode_tag . commit ?. sha ,
59+ latest_version_tag : vscode_tag . name ,
6060 current_version_age_days : age_days
6161 }
6262 } else {
Original file line number Diff line number Diff line change 11import * as vscode from 'vscode'
22import * as os from 'os'
33
4- export const update_extension = ( params : { commit_sha : string } ) => {
4+ export const update_extension = ( params : { tag_name : string } ) => {
55 const terminal = vscode . window . createTerminal ( 'CWC Updater' )
66 terminal . show ( )
77
@@ -10,11 +10,11 @@ export const update_extension = (params: { commit_sha: string }) => {
1010
1111 if ( os . platform ( ) === 'win32' ) {
1212 terminal . sendText (
13- `powershell -c "& ([scriptblock]::Create((irm https://raw.githubusercontent.com/CodeWebChat/CWC/main/install.ps1))) '${ uri_scheme } ' '${ lang } ' '${ params . commit_sha } '"`
13+ `powershell -c "& ([scriptblock]::Create((irm https://raw.githubusercontent.com/CodeWebChat/CWC/main/install.ps1))) '${ uri_scheme } ' '${ lang } ' '${ params . tag_name } '"`
1414 )
1515 } else {
1616 terminal . sendText (
17- `curl -fsSL https://raw.githubusercontent.com/CodeWebChat/CWC/main/install.sh | bash -s -- "${ uri_scheme } " "${ lang } " "${ params . commit_sha } "`
17+ `curl -fsSL https://raw.githubusercontent.com/CodeWebChat/CWC/main/install.sh | bash -s -- "${ uri_scheme } " "${ lang } " "${ params . tag_name } "`
1818 )
1919 }
2020}
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ import { PromptViewProvider } from '../prompt-view-provider'
44export const handle_update_extension = (
55 prompt_view_provider : PromptViewProvider
66) => {
7- if ( prompt_view_provider . update_info . latest_version_sha ) {
7+ if ( prompt_view_provider . update_info . latest_version_tag ) {
88 update_extension ( {
9- commit_sha : prompt_view_provider . update_info . latest_version_sha
9+ tag_name : prompt_view_provider . update_info . latest_version_tag
1010 } )
1111 }
1212}
Original file line number Diff line number Diff line change @@ -458,7 +458,7 @@ export interface SaveTasksMessage extends BaseMessage {
458458export type UpdateInfo = {
459459 is_available : boolean
460460 latest_version ?: string
461- latest_version_sha ?: string
461+ latest_version_tag ?: string
462462 current_version_age_days ?: number
463463}
464464
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ $ErrorActionPreference = "Stop"
22$ProgressPreference = " SilentlyContinue"
33$targetScheme = $args [0 ]
44$lang = $args [1 ]
5- $commitSha = $args [2 ]
5+ $tagName = $args [2 ]
66
77$msg_error = " Error:"
88$msg_git_required = " git is required but not installed."
@@ -486,8 +486,8 @@ foreach ($i in $indices) {
486486 $updated = Invoke-Step " $msg_step_cloning ..." {
487487 git - C $repoDir fetch origin -- quiet * > $null
488488 if ($LASTEXITCODE -ne 0 ) { throw " Failed to fetch" }
489- if ($commitSha ) {
490- git - C $repoDir checkout $commitSha -- quiet * > $null
489+ if ($tagName ) {
490+ git - C $repoDir checkout $tagName -- quiet * > $null
491491 if ($LASTEXITCODE -ne 0 ) { throw " Failed to checkout" }
492492 } else {
493493 git - C $repoDir reset -- hard origin/ main -- quiet * > $null
@@ -505,8 +505,8 @@ foreach ($i in $indices) {
505505 $null = Invoke-Step " $msg_step_cloning ..." {
506506 git clone - c core.longpaths= true -- quiet https:// github.com / CodeWebChat/ CWC.git $repoDir * > $null
507507 if ($LASTEXITCODE -ne 0 ) { throw " Failed to clone" }
508- if ($commitSha ) {
509- git - C $repoDir checkout $commitSha -- quiet * > $null
508+ if ($tagName ) {
509+ git - C $repoDir checkout $tagName -- quiet * > $null
510510 if ($LASTEXITCODE -ne 0 ) { throw " Failed to checkout" }
511511 }
512512 } $msg_step_cloning
Original file line number Diff line number Diff line change 33
44TARGET_SCHEME=" $1 "
55LANGUAGE=" ${2:- en} "
6- COMMIT_SHA =" $3 "
6+ TAG_NAME =" $3 "
77
88msg_error=" Error:"
99msg_git_required=" git is required but not installed."
@@ -489,8 +489,8 @@ chmod 700 "$CWC_DIR" 2>/dev/null || true
489489
490490update_repo () {
491491 git -C " $REPO_DIR " fetch origin --quiet && \
492- if [ -n " $COMMIT_SHA " ]; then
493- git -C " $REPO_DIR " checkout " $COMMIT_SHA " --quiet
492+ if [ -n " $TAG_NAME " ]; then
493+ git -C " $REPO_DIR " checkout " $TAG_NAME " --quiet
494494 else
495495 git -C " $REPO_DIR " reset --hard origin/main --quiet
496496 fi && \
@@ -499,8 +499,8 @@ update_repo() {
499499
500500clone_repo () {
501501 git clone -c core.longpaths=true --quiet https://github.com/CodeWebChat/CWC.git " $REPO_DIR " && \
502- if [ -n " $COMMIT_SHA " ]; then
503- git -C " $REPO_DIR " checkout " $COMMIT_SHA " --quiet
502+ if [ -n " $TAG_NAME " ]; then
503+ git -C " $REPO_DIR " checkout " $TAG_NAME " --quiet
504504 fi
505505}
506506
You can’t perform that action at this time.
0 commit comments