Skip to content

Commit 2d39dd1

Browse files
authored
Merge branch 'Bugsterapp:main' into main
2 parents 07f2212 + eb4a28b commit 2d39dd1

File tree

5 files changed

+87
-42
lines changed

5 files changed

+87
-42
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ All notable changes to Bugster CLI will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [0.3.20]
9+
10+
### Changed
11+
- Force chromium installation on install script
12+
- Remove the question loop on credentials during `bugster init`
13+
14+
## [0.3.19]
915

1016
### Changed
1117
- The `--page` flag in `bugster generate` now accepts relative or absolute file paths instead of page folder names. This provides more flexibility and control over which pages are analyzed.

bugster/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Bugster CLI - A command-line interface tool for managing test cases.
33
"""
44

5-
__version__ = "0.3.19"
5+
__version__ = "0.3.20"

bugster/commands/init.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,15 @@ def init_command():
150150
credentials = []
151151

152152
if Prompt.ask("➕ Would you like to add custom login credentials? (y/n)", default="y").lower() == "y":
153-
while True:
154-
identifier = Prompt.ask(
155-
"👤 Credential name",
156-
default="admin",
157-
)
158-
username = Prompt.ask("📧 Username/Email")
159-
password = Prompt.ask("🔒 Password", password=True)
160-
161-
credentials.append(create_credential_entry(identifier, username, password))
162-
InitMessages.credential_added()
163-
164-
if not Prompt.ask("➕ Add another credential? (y/n)", default="n").lower() == "y":
165-
break
153+
identifier = Prompt.ask(
154+
"👤 Credential name",
155+
default="admin",
156+
)
157+
username = Prompt.ask("📧 Username/Email")
158+
password = Prompt.ask("🔒 Password", password=True)
159+
160+
credentials.append(create_credential_entry(identifier, username, password))
161+
InitMessages.credential_added()
166162
else:
167163
credentials.append(create_credential_entry())
168164
InitMessages.using_default_credentials()

scripts/install.py

Lines changed: 66 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -476,20 +476,73 @@ def main():
476476

477477
# Print installation success message
478478
print_success("\n🎉 Bugster CLI has been installed successfully!")
479-
480-
if not path_added:
481-
print_warning(f"\nNote: Installation directory was not added to PATH:")
482-
print(f" {install_dir}")
483-
print("\nTo use Bugster CLI, either:")
484-
print(f" 1. Add {install_dir} to your PATH manually")
485-
print(f" 2. Run the full path: {installed_path}")
479+
480+
# Check if we're in an interactive environment
481+
import sys
482+
is_interactive = sys.stdin.isatty()
483+
484+
if is_interactive:
485+
# Only ask for terminal reset if we're in an interactive environment
486+
print_warning("\nWould you like to reset your terminal? (y/n)")
487+
try:
488+
choice = input().strip().lower()
489+
490+
if choice in ["y", "yes"]:
491+
print_step("Resetting terminal...")
492+
print("\nTo start using Bugster CLI, run:")
493+
print(" bugster --help")
494+
import signal
495+
system = platform.system()
496+
if system == "Windows":
497+
# On Windows, just exit gracefully
498+
print_warning("Please restart your command prompt manually.")
499+
sys.exit(0)
500+
else:
501+
# On Unix systems, kill the parent process
502+
os.kill(os.getppid(), signal.SIGKILL)
503+
else:
504+
# Show restart instructions only if user chose not to reset
505+
print("\nTo start using Bugster CLI, restart terminal and run:")
506+
print(" bugster --help")
507+
system = platform.system()
508+
if system == "Windows":
509+
print_warning("\nPlease restart your terminal to use Bugster CLI.")
510+
else:
511+
# Determine config file for Unix systems
512+
shell = os.environ.get("SHELL", "/bin/bash")
513+
home_dir = os.path.expanduser("~")
514+
if "zsh" in shell:
515+
config_files = [".zshrc", ".zprofile"]
516+
elif "bash" in shell:
517+
config_files = [".bashrc", ".bash_profile", ".profile"]
518+
elif "fish" in shell:
519+
config_files = [".config/fish/config.fish"]
520+
else:
521+
config_files = [".profile"]
522+
523+
config_file = None
524+
for cf in config_files:
525+
full_path = os.path.join(home_dir, cf)
526+
if os.path.exists(full_path):
527+
config_file = full_path
528+
break
529+
530+
if config_file:
531+
print_warning(f"\nPlease restart your terminal to use Bugster CLI or run:")
532+
print(f" source {config_file}")
533+
else:
534+
print_warning("\nPlease restart your terminal to use Bugster CLI.")
535+
except (EOFError, KeyboardInterrupt):
536+
# Handle non-interactive environments gracefully
537+
print("\nTo start using Bugster CLI, restart terminal and run:")
538+
print(" bugster --help")
486539
else:
487-
# Show restart/source message only if PATH was actually modified
540+
# Non-interactive environment (like curl), just show instructions
541+
print("\nTo start using Bugster CLI, restart terminal and run:")
542+
print(" bugster --help")
488543
system = platform.system()
489544
if system == "Windows":
490-
print_warning(
491-
"\n⚠️ You may need to restart your terminal/command prompt for PATH changes to take effect"
492-
)
545+
print_warning("\nPlease restart your terminal to use Bugster CLI.")
493546
else:
494547
# Determine config file for Unix systems
495548
shell = os.environ.get("SHELL", "/bin/bash")
@@ -511,15 +564,10 @@ def main():
511564
break
512565

513566
if config_file:
514-
print_warning("\n⚠️ You may need to restart your terminal or run:")
567+
print_warning(f"\nPlease restart your terminal to use Bugster CLI or run:")
515568
print(f" source {config_file}")
516569
else:
517-
print_warning(
518-
"\n⚠️ You may need to restart your terminal for PATH changes to take effect"
519-
)
520-
521-
print("\nTo start using Bugster CLI, run:")
522-
print(" bugster --help")
570+
print_warning("\nPlease restart your terminal to use Bugster CLI.")
523571

524572
finally:
525573
# Clean up

scripts/install.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,8 @@ else
460460
fi
461461

462462
print_step "Installing Playwright..."
463+
CI=true npx -y playwright@1.53.0 install --with-deps chromium > /dev/null 2>&1
463464
npx -y @playwright/mcp@latest --version
464-
npx -y playwright@1.53.0 install --with-deps chrome
465-
466465
# Download and run the Python installer script with version argument
467466
print_step "Downloading the Bugster CLI installer..."
468467

@@ -482,13 +481,9 @@ else
482481
fi
483482

484483
exit_code=$?
485-
if [[ $exit_code -eq 0 ]]; then
486-
# Show shell reload instructions
487-
shell=${SHELL##*/}
488-
config_file="$HOME/.${shell}rc"
489-
print_warning "Please restart your terminal or run:"
490-
echo -e "${BLUE}source $config_file${NC}"
491-
echo -e "\nTo use Bugster CLI, run: ${GREEN}bugster --help${NC}"
484+
if [[ $exit_code -ne 0 ]]; then
485+
print_error "❌ Installation failed"
486+
exit $exit_code
492487
fi
493488

494489
exit $exit_code

0 commit comments

Comments
 (0)