Skip to content
Permalink
Browse files

Merge pull request #8 from cruise-automation/collin/readme_fix_filecmp

fix up readme for filecmp
  • Loading branch information...
crmulliner committed Oct 15, 2019
2 parents 731803c + b1f9005 commit b31e8b5f89239a5014cb4017e7d8e0a054d296d9
Showing with 33 additions and 33 deletions.
  1. +33 −33 Readme.md
@@ -294,39 +294,6 @@ Example Output:
}
```

### File Compare Check

The `FileCmp` (File Compare) check is a mechanism to compare a file from a previous
run with the file from the current run. The main idea behind this check is to provide
more insights into file changes, since it allows comparing two versions of a file rather than
comparing only a digest.

This works by saving the file as the `OldFilePath`
(if it does not exist) and skipping the check at the first run. In consecutive runs
the current file and the saved old file will be copied to a temp directory. The script will
be executed passing the original filename, the path to the old file and the path to the current file
as arguments. If the script prints output the check will be marked as failed.

- `File` : string, the full path of the file
- `Script`: string, path to the script
- `ScriptOptions`: string, argument passed to the script
- `OldFilePath`: string, filename (absolute or relative) to use to store old file
- `InformationalOnly` : bool, (optional) the result of the check will be Informational only (default: false)

Script runs as:
```sh
script.sh <OrigFilename> <oldFile> <newFile> -- <argument>
```

Example:
```toml
[FileCmp."test.txt"]
File = "/test.txt"
Script = "diff.sh"
OldFilePath = "test.txt"
InformationalOnly = true
```

#### Json Field Compare

- `File` : string, the full path of the file
@@ -361,6 +328,39 @@ Example Output:
}
```

### File Compare Check

The `FileCmp` (File Compare) check is a mechanism to compare a file from a previous
run with the file from the current run. The main idea behind this check is to provide
more insights into file changes, since it allows comparing two versions of a file rather than
comparing only a digest.

This works by saving the file as the `OldFilePath`
(if it does not exist) and skipping the check at the first run. In consecutive runs
the current file and the saved old file will be copied to a temp directory. The script will
be executed passing the original filename, the path to the old file and the path to the current file
as arguments. If the script prints output the check will be marked as failed.

- `File` : string, the full path of the file
- `Script`: string, path to the script
- `ScriptOptions`: string, argument passed to the script
- `OldFilePath`: string, filename (absolute or relative) to use to store old file
- `InformationalOnly` : bool, (optional) the result of the check will be Informational only (default: false)

Script runs as:
```sh
script.sh <OrigFilename> <oldFile> <newFile> -- <argument>
```

Example:
```toml
[FileCmp."test.txt"]
File = "/test.txt"
Script = "diff.sh"
OldFilePath = "test.txt"
InformationalOnly = true
```

### File Tree Check

The `FileTree` check generates a full filesystem tree (a list of every file and directory) and compares it with a previously saved file tree. The check will produce an informational output listing new files, deleted files, and modified files.

0 comments on commit b31e8b5

Please sign in to comment.
You can’t perform that action at this time.