I'm trying to follow this tutorial. Basically, I want to create my custom function that creates a folder if it not exists.
var makeDir = (path) => {
const file = Gio.file_new_for_path(path);
if (file.query_exists(path)) {
print(`Dir already exists ${path}`);
return;
}
print(`My Path: ${path}`);
// file.make_directory(path);
};
When I run this code I'm receiving an error:
Gjs-CRITICAL **: 17:35:17.161: JS ERROR: Error: Expected an object of type GCancellable for argument 'cancellable' but got type string
In the documentation I see that GCancellable is optional. So I have no idea why my code does not work. Haw can I make it work?