github.com/aspring/packer@v0.8.1-0.20150629211158-9db281ac0f89/website/source/docs/command-line/fix.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Fix - Command-Line"
     4  description: |-
     5    The `packer fix` Packer command takes a template and finds backwards incompatible parts of it and brings it up to date so it can be used with the latest version of Packer. After you update to a new Packer release, you should run the fix command to make sure your templates work with the new release.
     6  ---
     7  
     8  # Command-Line: Fix
     9  
    10  The `packer fix` Packer command takes a template and finds backwards incompatible
    11  parts of it and brings it up to date so it can be used with the latest version
    12  of Packer. After you update to a new Packer release, you should run the
    13  fix command to make sure your templates work with the new release.
    14  
    15  The fix command will output the changed template to standard out, so you
    16  should redirect standard using standard OS-specific techniques if you want to
    17  save it to a file. For example, on Linux systems, you may want to do this:
    18  
    19  ```
    20  $ packer fix old.json > new.json
    21  ```
    22  
    23  If fixing fails for any reason, the fix command will exit with a non-zero
    24  exit status. Error messages appear on standard error, so if you're redirecting
    25  output, you'll still see error messages.
    26  
    27  -> **Even when Packer fix doesn't do anything** to the template,
    28  the template will be outputted to standard out. Things such as configuration
    29  key ordering and indentation may be changed. The output format however, is
    30  pretty-printed for human readability.
    31  
    32  The full list of fixes that the fix command performs is visible in the
    33  help output, which can be seen via `packer fix -h`.