Update autodocAI authored by Ramicés dos Santos Silva's avatar Ramicés dos Santos Silva
......@@ -91,7 +91,7 @@ BITO_VERSION=`$BITO_CMD -v | awk '{print $NF}'`
if awk "BEGIN {exit !($BITO_VERSION > 3.7)}"; then
BITO_CMD_VEP="--agent create_code_doc"
fi
```
### 2. Verificação de Argumentos
O script verifica se um nome de diretório foi fornecido como argumento de linha de comando. Se não for fornecido, o script exibe uma mensagem de erro e encerra.
......@@ -119,7 +119,7 @@ doc_folder="doc_$(basename $folder)"
if [ ! -d "$doc_folder" ]; then
mkdir -p "$doc_folder"
fi
```
### 4. Generating Documentation
The script finds all files with specific extensions in the provided directory and its subdirectories. For each file found, it creates a corresponding directory structure in the documentation directory. It generates documentation for each file using the `bito` command and saves the documentation in the appropriate directory.
......@@ -145,14 +145,14 @@ find "$folder" -type f -name "*.sh" -o -name "*.py" -o -name "*.php" -o -name "*
# bito -p docprmt.txt -f "$file" >> "$file2write"
cat $file | bito -p ./prompts/structured_doc.txt $BITO_CMD_VEP > $file2write
done
```
### 5. Finalization
After generating documentation for all files, the script displays a message indicating where the documentation has been created.
```bash
echo "Documentation created in $doc_folder"
```
### 6. Usage
......@@ -160,4 +160,4 @@ To use the script, run the following command, replacing `<folder_name>` with the
```bash
./script_name.sh <folder_name>
```