Skip to content

Conversation

Copy link

Copilot AI commented Jan 7, 2026

Cloud agent has begun work on make this script cle... and will update this pull request as work progresses.

Original prompt

make this script cleaner, remove the coloring and move the check to the beginning (cheks for curl, unzip, etc.)

The user has attached the following uncommitted or modified files as relevant context:
totalsegmentator.sh
#!/bin/bash

Configuration

URL="https://www.dropbox.com/scl/fi/oq0fsz8oauory204g8o6f/Totalsegmentator_dataset_v201.zip?rlkey=afnl2ixhqca2ukkf1v9p6jz7p&dl=1"
DEST_DIR="/mount/data/totalsegmentator"
ZIP_FILE="dataset.zip"

Colors for output

GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

Check dependencies

echo -e "${BLUE}Checking dependencies...${NC}"
MISSING_DEPS=0

if ! command -v unzip &> /dev/null; then
echo "Error: 'unzip' is not installed."
MISSING_DEPS=1
fi

if ! command -v curl &> /dev/null && ! command -v wget &> /dev/null; then
echo "Error: Neither 'curl' nor 'wget' is installed."
MISSING_DEPS=1
fi

if [ $MISSING_DEPS -ne 0 ]; then
echo "Please install missing dependencies to proceed."
exit 1
fi

echo -e "${BLUE}Starting download and setup process...${NC}"

Create destination directory

if [ ! -d "$DEST_DIR" ]; then
echo -e "Creating directory: ${GREEN}$DEST_DIR${NC}"
mkdir -p "$DEST_DIR"
else
echo -e "Directory ${GREEN}$DEST_DIR${NC} already exists."
fi

Download

echo -e "${BLUE}Downloading dataset from Dropbox...${NC}"
if command -v curl &> /dev/null; then
curl -L -o "$DEST_DIR/$ZIP_FILE" "$URL"
elif command -v wget &> /dev/null; then
wget -O "$DEST_DIR/$ZIP_FILE" "$URL"
else
echo "Error: Neither curl nor wget is installed. Please install one to proceed."
exit 1
fi

Unzip

echo -e "${BLUE}Unzipping archive...${NC}"
if command -v unzip &> /dev/null; then
unzip "$DEST_DIR/$ZIP_FILE" -d "$DEST_DIR"
else
echo "Error: unzip is not installed. Please install it to proceed."
exit 1
fi

Cleanup

echo -e "${BLUE}Cleaning up zip file...${NC}"
rm "$DEST_DIR/$ZIP_FILE"

echo -e "${GREEN}Success! Dataset located in: $(pwd)/$DEST_DIR${NC}"

totalsegmentator.sh

Created from VS Code via the GitHub Pull Request extension.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@gasperpodobnik gasperpodobnik deleted the copilot/clean-script-and-check-dependencies branch January 7, 2026 09:18
Copilot AI requested a review from gasperpodobnik January 7, 2026 09:18
Copilot stopped work on behalf of gasperpodobnik due to an error January 7, 2026 09:18
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.

2 participants