![]() ![]() This method is implemented efficiently on MSW and macOS, but should be used with care on other platforms for directories with lots of children (e.g. This is the same as Add, but also recursively adds every file/directory in the tree rooted at path.Īdditionally a file mask can be specified to include only files matching that particular mask. This is currently implemented only for GTK.īool AddTree ( self, path, events=FSW_EVENT_ALL, filter="" ) ¶ Path ( string) – The name of the path to watch.Įvents ( int) – An optional filter to receive only events of particular types. To watch the symlink itself and not its target you may call FileName.DontFollowLink on path. Note that on platforms that use symbolic links, you should consider the possibility that path is a symlink. Use AddTree to monitor the directory recursively. ![]() The path argument can currently only be a directory and any changes to this directory itself or its immediate children will generate the events. Add ( self, path, events=FSW_EVENT_ALL ) ¶ Methods ¶ _init_ ( self ) ¶ĭefault constructor. If true, next command will be run before this one finishes.Ĭommands support placeholders similar to FileSystemWatcher class allows receiving notifications of file "isAsync" (optional) - defaults to false.Can include parameters that will be replaced at runtime (see Placeholder Tokens section below). NOTE Since this is a Regex, and also in a JSON string backslashes have to be double escaped such as when targetting folders. "notMatch" - a regex for matching files not to run commands on."match" - a regex for matching which files to run commands on."commands" - array of commands that will be run whenever a file is saved.onFileChange and onFolderChange) in synchronous or asynchronous mode. "isSyncRunEvents" - (optional) launches event handlers of the same name with the appropriate pattern 'match' or 'notMatch' (e.g."statusBarDelay" - (optional) the time after which the status returns to normal."isClearStatusBar" - (optional) returns the status bar to its normal position (after receiving a 'Success' or 'Error' status) after a some time."autoClearConsole" - (optional) clear VSCode output console every time commands run."shell" - (optional) shell path to be used with child_process.exec options that runs commands.Regex pattern matching for files that trigger commands runningĪdd "filewatcher" configuration to user or workspace settings. ![]() Configure multiple commands that run when the event happened.onFolderCreate - allows to track the addition of files.onFolderDelete - allows to track the deletion of files.onFolderChange - allows to track the modification of files.onFileCreate - allows to track the creation of file(s). ![]() onFileRename - allows to track the renaming of file(s).onFileDelete - allows to track the deletion of file(s).onFileChange - allows to track changes to the contents of an existing file.Following events: onSaveDocument, onFileDelete, onFileRename, onFileCreate, onFolderChange, onFolderDelete and onFolderCreate:.This extension allows configuring commands that get run whenever a file is saved (changed, deleted, renamed, created) or folder is changed (deleted, created) in vscode. ![]()
0 Comments
Leave a Reply. |