Skip to content

Fix formatting issues in index.html#8

Open
ohdaveed wants to merge 1 commit intox-cmd:mainfrom
ohdaveed:patch-1
Open

Fix formatting issues in index.html#8
ohdaveed wants to merge 1 commit intox-cmd:mainfrom
ohdaveed:patch-1

Conversation

@ohdaveed
Copy link
Copy Markdown

fixed formatting error

Copilot AI review requested due to automatic review settings January 16, 2026 11:31
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 16, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request claims to fix formatting issues in index.html (which contains a shell script), but the changes actually introduce numerous bugs by adding extraneous spaces in critical locations that will break file paths, command syntax, and string operations.

Changes:

  • Added spaces before .tgz file extensions throughout, breaking URL and file path construction
  • Added spaces in hidden directory references (e.g., .x-cmd becomes . x-cmd)
  • Modified function definition syntax for ___x_cmd_get_bootinit
  • Added trailing spaces after semicolons and before closing braces in various locations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

local url="https://raw.githubusercontent.com/x-cmd/release/main";
case "$___X_CMD_VERSION" in
latest|alpha|beta) url="$url/dist/${___X_CMD_VERSION}.tgz" ;;
latest|alpha|beta) url="$url/dist/${___X_CMD_VERSION}. tgz" ;;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inserted before 'tgz' breaks the file extension. URLs will be malformed (e.g., 'latest. tgz' instead of 'latest.tgz'), causing download failures. Remove the space to restore correct URL construction.

Copilot uses AI. Check for mistakes.
latest|alpha|beta) url="$url/dist/${___X_CMD_VERSION}. tgz" ;;
v0.1.*|v0.2.*|v0.3.*|v0.4.*|v0.5.0|v0.5.1)
url="$url/dist/${___X_CMD_VERSION}/full.tgz" ;;
url="$url/dist/${___X_CMD_VERSION}/full. tgz" ;;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inserted before 'tgz' breaks the file extension. This will construct invalid URLs like 'full. tgz' instead of 'full.tgz', causing download failures. Remove the space.

Copilot uses AI. Check for mistakes.
url="$url/dist/${___X_CMD_VERSION}/full. tgz" ;;
v*) url="$url/dist/${___X_CMD_VERSION}/allinone.tgz" ;;
*) url="$url/sum/${___X_CMD_VERSION}.tgz" ;;
*) url="$url/sum/${___X_CMD_VERSION}. tgz" ;;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inserted before 'tgz' breaks the file extension. This malforms URLs, changing '.tgz' to '. tgz', which will cause download failures. Remove the space.

Copilot uses AI. Check for mistakes.

local target="$tmptgt/download_tmp.tgz";
[ ! -d "${tmptgt}" ] || {
local target="$tmptgt/download_tmp. tgz";
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inserted before 'tgz' breaks the file path. This creates a file named 'download_tmp. tgz' (with space) instead of 'download_tmp.tgz', causing mismatches when the file is referenced later. Remove the space.

Copilot uses AI. Check for mistakes.
___x_cmd_get_populate(){
local tmptgt="$1"; local sumfp="$tmptgt/.x-cmd/metadata/version_sum";
[ ! -r "$sumfp" ] || . "$sumfp";
local tmptgt="$1"; local sumfp="$tmptgt/. x-cmd/metadata/version_sum";
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inserted after the dot breaks the hidden directory reference. The path becomes '. x-cmd' instead of '.x-cmd', which will fail to locate the metadata directory. Remove the space.

Copilot uses AI. Check for mistakes.
};

___X_CMD_VERSION_SUM8="${___X_CMD_VERSION_SUM%"${___X_CMD_VERSION_SUM#????????}"}";
___X_CMD_VERSION_SUM8="${___X_CMD_VERSION_SUM%"${___X_CMD_VERSION_SUM#???????? }"}";
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inserted inside the string manipulation pattern breaks the logic. The pattern '#???????? ' (with space) will not match the intended 8 characters. This should be '#????????' without the space. Remove the space.

Suggested change
___X_CMD_VERSION_SUM8="${___X_CMD_VERSION_SUM%"${___X_CMD_VERSION_SUM#???????? }"}";
___X_CMD_VERSION_SUM8="${___X_CMD_VERSION_SUM%"${___X_CMD_VERSION_SUM#????????}"}";

Copilot uses AI. Check for mistakes.
local target="$tmptgt/download_tmp.tgz";
local archivedir="$___X_CMD_ROOT/global/shared/version/archive";
local archivefile="$archivedir/.${___X_CMD_VERSION_SUM8}.tgz";
local archivefile="$archivedir/. ${___X_CMD_VERSION_SUM8}.tgz";
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inserted after the dot breaks the hidden file reference. This creates a path with '. filename' instead of '.filename', which will fail to match archived files. Remove the space.

Copilot uses AI. Check for mistakes.

local sum8dir="$___X_CMD_ROOT/v/.${___X_CMD_VERSION_SUM8}";
[ ! -e "$sum8dir" ] || {
local sum8dir="$___X_CMD_ROOT/v/. ${___X_CMD_VERSION_SUM8}";
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inserted after the dot breaks the hidden directory reference. The path becomes '. dirname' instead of '.dirname', causing directory operations to fail. Remove the space.

Copilot uses AI. Check for mistakes.
printf "___X_CMD_VERSION0=%s\n" "${___X_CMD_VERSION}";
printf "___X_CMD_VERSION=%s\n" ".${___X_CMD_VERSION_SUM8}";
printf ". \"\$___X_CMD_ROOT/v/%s/X\"\n" ".${___X_CMD_VERSION_SUM8}";
printf "___X_CMD_VERSION=%s\n" ". ${___X_CMD_VERSION_SUM8}";
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inserted after the dot in the version string breaks the reference. This should be '.${___X_CMD_VERSION_SUM8}' without a space to match the hidden directory naming convention. Remove the space.

Copilot uses AI. Check for mistakes.
printf "___X_CMD_VERSION=%s\n" ".${___X_CMD_VERSION_SUM8}";
printf ". \"\$___X_CMD_ROOT/v/%s/X\"\n" ".${___X_CMD_VERSION_SUM8}";
printf "___X_CMD_VERSION=%s\n" ". ${___X_CMD_VERSION_SUM8}";
printf ". \"\$___X_CMD_ROOT/v/%s/X\"\n" ". ${___X_CMD_VERSION_SUM8}";
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple issues: space inserted after the dot in the source command ('. ' should be '.'), and space inserted in the version reference ('. ${...' should be '.${...'). Both break functionality. Remove both spaces.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants