github.com/kikitux/packer@v0.10.1-0.20160322154024-6237df566f9f/website/source/docs/command-line/fix.html.md (about)

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