You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `ErrorDeterminingExtendedAttributes` signifies that we failed to determine if
31
+
* the given path contains extended attributes; to be safe, we are not managing
32
+
* this file.
33
+
*/
34
+
exportconstErrorDeterminingExtendedAttributes=
35
+
newErrorWithPath(({ path }: {path: string})=>`Failed to determine if \`${path}\` contains extended attributes`);
36
+
/**
37
+
* `ErrorHasExtendedAttributes` signifies that we were unable to process a file
38
+
* because it has extended attributes that would not have been preserved had we
39
+
* tried to edit it.
40
+
*/
41
+
exportconstErrorHasExtendedAttributes=
42
+
newErrorWithPath(({ path }: {path: string})=>`Refusing to manage \`${path}\` which has extended attributes`);
43
+
/**
44
+
* `ErrorNotRegularFile` signifies that we were unable to process a file because
45
+
* it is not a regular file (e.g. a named pipe or a device).
46
+
*/
47
+
exportconstErrorNotRegularFile=
48
+
newErrorWithPath(({ path }: {path: string})=>`Refusing to manage \`${path}\` which is neither a regular file nor a symbolic link`);
49
+
/**
50
+
* `ErrorWritingFile` signifies that we attempted to process a file but writing
51
+
* to it resulted in unexpected contents.
52
+
*/
53
+
exportconstErrorWritingFile=
54
+
newErrorWithPath(({ path, backupPath }: {path: string,backupPath: string})=>`Error writing to \`${path}\`: written contents are unexpected; see backup in \`${backupPath}\``);
55
+
9
56
/**
10
57
* Inserts/removes fenced lines into/from a file. Idempotent.
11
58
* @param path The path to the file to work on.
12
59
* @param desiredManagedLines The lines to insert into the file.
13
60
* @param desiredPresent Whether the lines should be present.
61
+
* @throws If the file could not be managed; for example, if it has extended
62
+
* attributes, is not a regular file, or a backup exists.
0 commit comments