Trying to automate file move on subdirectory change with Watchman(or any other tool that can do this) - automation

Currently while working with watchman, I am trying to watch a directory, and when any new directory is created in that directory, that contains a file with the wildcard *.m*, it would start a trigger. However this is not working as expected.
I am watching the directory /media with the following:
watchman watch /media
My current trigger is set as follows:
[
"trigger",
"/media",
{
"name": "movieReady",
"expression": [
"anyof",
["match", "**/*.m*", "basename"]
],
"command": ["python", "/scripts/dhooks/files/downloader.py"]
}
]
So the goal is when any new media file hits /media/NewDirectory/mediafile.mkv
that it triggers that downloader.py, but watchman is not currently setting the trigger as it should when I move a folder with a test file to /media/
Any help would be greatly appreciated, thanks!

I found the solution was to use ["match", "*", "basename"] instead of ["match", "**/*.m*", "basename"], and then just filter in the pyhon script for what I need.

Related

error: no browser selected to run against, but i mentioned it in .testcafe.json

I have created .testcaferc.json, I mentioned the browser and src in it. so I should be able to run tests without putting this in the command line.
But it does not seem to be reading my config file from the project folder.
{
"src": "c:/Testcafe/Login.js",
"browsers": "firefox",
"reporter": {
"name": "html",
"output": "reports/report.html"
},
"takeScreenshotsOnFails": true,
"screenshotPath": "/screenshots/"
}
Actual:
Using locally installed version of TestCafe.
ERROR No browser selected to test against.
Type "testcafe -h" for help.
Expected:
I should not ask for browser and test file parameter as both are provided in config file.
The configuration file is a feature added in v1.0.0. If you upgrade from 0.20.5 to 1.0.0 or later, you will be able to use the configuration file for your tests.
Release Notes:
https://github.com/DevExpress/testcafe/releases/tag/v1.0.0

plugin not found error in node.js command prompt

I have configured cumulocity.json as below:
{
"name": "Cumulocityexercises",
"availability": "PRIVATE",
"contextPath": "cumulocityexercises",
"key": "cumulocityexercises-appkey",
"resourcesUrl": "/",
"type": "HOSTED",
"tabsHorizontal": true,
"imports": [
"core/c8yBranding",
"cumulocityexercises/myplugin",
"cumulocityexercises/docsplugin"
]
}
but when I am trying to build the plugin:my plugin, I am getting an error like plugin not found. Can anyone help me with this please?
This is most likely linked to your project structure. It should look similar to the screenshot below and then you would need to run the command from the root level (cumulocity-enhanced-ui in the screenshot).
You need to run the following command to build a single plugin
c8y build:plugin <<pluginFolderName>>
c8y build:plugin dashboardUtils
Same goes for the manifest declarations. They need to match the plugin folder names (case sensitive)
What's exactly the command you are using to build the plugin?
If it is something like this:
$ c8y build:plugin docsplugin
docsplugin plugin not found
then you may check that your plugin directory has the same name as specified in the JSON file, i.e. cumulocity.json manifest file in the main app directory. A second manifest file goes in the plugin directory.
Note that you must execute the build command from the main app directory which in your case is cumulocityexercises, otherwise you will get the same error message.

VSCode intellisense doesn't work with ES6 import?

I'm stucking with this trouble for days.
import abc from './abc' doesn't work, the abc.xyz() or any function inside it will not be suggested.
Even the file abc.js will not be suggested
I have to use abc = required('./abc.js') and things work fine.
Both file suggestion and method will be available
I've tried to added jsconfig.json and force it to use "module":"es6" but didn't work either.
Already got react native tools installed.
Couldn't get it work eventually.
Edit:
i found out that module.exports = User doesn't work anymore. I have to write export default User if i want to access to all the method, since when and how to get old school export works?
Change your jsconfig.json to
{
"compilerOptions": {
"target": "es6"
},
"exclude": [
"node_modules"
]
}
and then you might need to restart VScode
the option module is used for typescript, more on this here

No executable found matching command dotnet-projectmodel-server, VS2015

I am trying to build a new front end application with dotnet core but getting an error as below while to open the project.
i followed that answer but not working for me.
getting this error while trying to restore :
error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
running dotnet restore command gives below error :
error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.1\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
I got the same problem yesterday.
Unfortunately, I don't know exactly what I was doing wrong, but I managed to solve my error.
I used the strategy on this page here
I added a global.json file in my Solution Items and I specified all the .xproj projects of my solution.
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-003121"
}
Hope it helps.
Running dotnet-restore solved this issue for me. This was after i had updated the global.js to tarket the specific SDK version.
https://learn.microsoft.com/en-us/dotnet/articles/core/tools/dotnet-restore

Aurelia CLI include Bootstrap Glyphicons

I'm trying to include Bootstrap in my Aurelia CLI project, and the CSS and JS work fine.
The only problem I have is the glyphicons require font files to be loaded.
I use this configuration:
"dependencies": [
{
"name": "bootstrap",
"path": "../node_modules/bootstrap/dist",
"main": "js/bootstrap.min",
"deps": ["jquery"],
"exports": "$",
"resources": [
"css/bootstrap.min.css",
"fonts/glyphicons-halflings-regular.woff2"
]
}
]
But I get an error containing this line:
path: 'C:\Users\randy\Documents\form\node_modules\bootstrap\dist\fonts\glyphicons-halflings-regular.js'
So even though I include the .woff2 file, Aurelia tries to import the file as a JS file. What can I do to make this work? CSS does work fine.
It looks like this is a bug in the current version of the Aurelia CLI. I've submitted an issue for you here: https://github.com/aurelia/cli/issues/248
Aurelia can't process font files. You must use manual bundle task for it.
Here is similar solution for font-awesome: https://stackoverflow.com/a/39544587/1276632
Here is solution for glyphicons (I used it for bootstrap v4 integration): https://github.com/aurelia/cli/issues/248#issuecomment-250967074
This has been solved, for more information read the Github issue.
This issue can now be solved by adding a copy instruction in the aurelia.json.
aurelia.json - valid if the project was created by aurelia-cli 0.25.0 or greater
Add the following in the build block:
"bundles": [ ... ],
"copyFiles": {
"node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2": "bootstrap/fonts",
"node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff": "bootstrap/fonts",
"node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf": "bootstrap/fonts"
}
If the project was created by an older CLI version, you will have to create the copy task inside the tasks folder
https://github.com/aurelia/cli/blob/master/lib/resources/tasks/copy-files.js.
After that, call the copy task in the build.js/ts task
https://github.com/aurelia/cli/blob/master/lib/resources/tasks/build.js#L15
&ast; credits to fabioluz for commenting this on github