christosgalano / bicep-docs

bicep-docs is a command-line tool that generates documentation for Bicep templates.
MIT License
20 stars 0 forks source link

error processing main.bicep: failed to run command: exit status 1: #4

Closed winticloud closed 9 months ago

winticloud commented 9 months ago

Description

Expected Behavior

markdown file should be created

Actual Behavior

running bicep-docs.exe exits with error message

Possible Fix

n/a

Steps to Reproduce

  1. download Windows release bicep-docs_windows_amd64.zip
  2. extract in download folder
  3. check with virustotal.com (all clean)
  4. open cmd.exe as normal user
  5. cd into local repository into directory with main.bicep and existing README.md

    
    yxz>dir
    Volume in drive C is Windows
    
    Directory of xyz

23/01/2024 16:38

. 22/01/2024 15:15 .. 23/01/2024 16:38 4.834 main.bicep 23/01/2024 16:38 modules 23/01/2024 16:38 parameters 15/01/2024 19:22 17 README.md

7. run xyz\Downloads\bicep-docs_windows_amd64\bicep-docs.exe without any command line options. result:
`error processing main.bicep: failed to run command: exit status 1:` expected results: start creating markdown file or show some output similar to bicep-docs.exe -h

bicep-docs.exe -h bicep-docs is a command-line tool that generates documentation for Bicep templates.

Given an input Bicep file or directory, it parses the file(s) and generates corresponding documentation in Markdown format.

If the input is a directory, it will recursively parse all main.bicep files inside it. The output will be a corresponding README.md file in the same directory as the main.bicep file.

If the input is a Bicep file, the output must be a file; otherwise an error will be returned. The default value for the output is README.md, relative to the directory where the command is executed.

If the Markdown file already exists, it will be overwritten.

Azure CLI or the Bicep CLI must be installed for this tool to work.

Usage: bicep-docs [flags]

Flags: -h, --help help for bicep-docs -i, --input string input Bicep file or directory (default ".") -o, --output string output Markdown file; ignored if input is a directory (default "README.md") -V, --verbose verbose output -v, --version version for bicep-docs

8. running with commandline options still doesn't work

xyz\Downloads\bicep-docs_windows_amd64\bicep-docs.exe -i .\main.bicep -o README.md -V error processing .\main.bicep: failed to run command: exit status 1:


## Context
<!--- How has this bug affected you? What were you trying to accomplish? -->
n/a

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->

bicep-docs.exe -v bicep-docs version v1.0.0

az --version azure-cli 2.56.0

core 2.56.0 telemetry 1.1.0

Dependencies: msal 1.24.0b2 azure-mgmt-resource 23.1.0b2

bicep --version Bicep CLI version 0.14.6 (f1dae160cd)

az bicep version Bicep CLI version 0.24.24 (5646341b0c)

systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version" OS Name: Microsoft Windows 11 Pro OS Version: 10.0.22621 N/A Build 22621]

winticloud commented 9 months ago

After having updated my bicep version to the most recent one, it works:

winget install -e --id Microsoft.Bicep
Found an existing package already installed. Trying to upgrade the installed package...
Found Bicep CLI [Microsoft.Bicep] Version 0.24.24
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/Azure/bicep/releases/download/v0.24.24/bicep-setup-win-x64.exe
  ██████████████████████████████  28.3 MB / 28.3 MB
Successfully verified installer hash
Starting package install...
Successfully installed
C:\_dev\IaC-Demo\fortigate>bicep --version
Bicep CLI version 0.24.24 (5646341b0c)

@christosgalano would it be worth to mention what the minimum required Bicep version needs to be? From the note

NOTE: To run bicep-docs, either the Azure CLI or the Bicep CLI must be installed.

it seems as either Bicep CLI or Azure CLI needs to be installed and no specific version is required. In my case the Azure CLI was up-to-date but it still didn't work. Only after I updated Bicep CLI

christosgalano commented 9 months ago

Thanks for your feedback @winticloud.

I am going to update the documentation to include the minimum required version:

christosgalano commented 9 months ago

Thanks for your feedback. Release v1.1.0 is out and includes vars and user-defined data types & functions. It also includes the minimum required versions of Azure & Bicep CLI.

I am closing this issue.