how to extend command VSIX? - vsix

I have created a VSIX project (community) and I would like to execute my command after the original one is executed.
For example:
When I click the button git->fetch,
I want fetch hello world to be printed.

Related

How can I choose my own build file in vs code?

It`s my first steps in Haxe)
I need to build task with my own build task in VS code. I know that I can choose build task to run by using Shift+Ctrl+B, but no drop down list opens... And when I did find the list, my assembly file was not there...
If you don't define a task in tasks.json then Shift+Ctrl+B will not show you anything.
If you have different configuration files you can use Command Variable and the command extension.commandvariable.file.pickFile to create a QuickPick list of files to choose from and use it as an argument to Haxe

How to get compile/build date on Flutter App?

I know how to get the version using package_info, but how to get the build timestamp on Runtime both on ios and android?
You can use a build shell script that creates/updates a Dart file in lib/... with constants holding the date before running flutter build ....
You then import that file in your code and use it.
I'll suggest that you also consider basically rolling your own version of the package_info library which includes all the information you want to get from the platform code. I use the Gradle build files to update some variables on each build, which I then retrieve from Flutter.
Examining the package_info code shows that it is really a fairly simple MethodChannel use case. You could add anything that you can get from the native side.
Expanding on Günter Zöchbauer answer...
Create a text file in your source folder and enter the following
#!/bin/sh
var = "final DateTime buildDate =
DateTime.fromMillisecondsSinceEpoch(($(date "+%s000")));"
echo "$var" > lib/build_date.dart
Save the text file as
build_date_script.sh
In Android Studio, open Edit Configurations -> Add New Configuration and add a new 'Shell Script'
Give it a name, such as 'Write build date'
Select 'Script file' and enter the location of the 'build_date_script.sh' we created it stage 2.
Download and install GitBash https://gitforwindows.org/
Back to Android Studio, change the interpreter path to 'C:\Program Files\Git\git-bash.exe'.
Uncheck 'Execute in terminal' and click 'Apply'
Then in your main flutter run configuration, add a 'Before launch' item, select 'Run another configuration' and choose the script config we named in stage 4.
Click OK.
Now every time you build it will create a new dart file in your lib folder called 'build_date.dart' with a variable called 'buildDate' for use as a build date within your application.

How could I use pytest-html in Pycharm?

I have installed pytest-html and want to use it generate html report after run pytest in pycharm.
like this:
but it pops error:
ERROR: file not found: html=report\result.html
after run. So how to modify the arguments?
use
--html=Reports/Report.html --self-contained-html
in additional argument section of pycharm
If your using terminal to run the test try this instead this will work .
py.test --html=demoreport.html
If you want to run via pycharm, just by Right click on the project, follow below steps:
Add new configuration in Pycharm: At Configuration popup: Click '+', Python tests->pytest, provide "working directory" and "target" values with the path of the project.
Then after, Create a new file pytest.ini in the root folder of the project and provide the below values:
[pytest]
addopts = --html=reports/Report.html
python_files = tests/*.py
where, tests/*.py is a folder which contains all tests.
Now, just right click on your project and select Run 'pytest in ProjectFolderName' and you will find that report is created inside reports folder with name Report.html

PyDev Unit Test Set Run Directory

I have a PyDev unit test module that lives at the path:
$(PYDEV_PROJECT_ROOT)/tests/my_unit_test.py
I am attempting to use Eclipse PyDev's unit testing facilities. My unit test must read a configuration file like so:
(foo,bar,baz) = myModule.readOptimizationConfig("tests/optimization_config_file.cfg")
However, this will not work because PyDev goes into the 'tests' directory before running, and so specifying 'tests/' in the path given to readOptimizationConfig makes it attempt to load
$(PYDEV_PROJECT_ROOT)/tests/tests/optimization_config_file.cfg
However, I also need to run these tests using nosetests from the command lin.
This is because, in order to run ALL the tests for my project, rather than the option for running them in a particular file that is provided by default, the easiest solution was to just use the 'nosetests' command, rather than messing with Eclipse launch configurations. However, nosetests needs to be be run from the $(PYDEV_PROJECT_ROOT) root directory, so it needs the 'tests/' specified in the path.
Is there a way to force eclipse to run the unit tests from the project root directory, so that the paths that I pass to readOptimizationConfig will work for both methods?
It is possible to do this in PyDev, but you have to do it per every launch configuration so it's a bit boring.
Anyway, you first try to run as your script containing the unit-test (as you normally would - e.g. the dropdown menu next to the green "Run" arrow button then Run as... - Python unit-test). This launch will fail because of your missing cfg file. Now go to Run configurations (Run dropdown - Run configurations), open the Arguments tab and in the bottom under Working directory enter the path you want (or browse for it using the Workspace... button). For example if you want to run from project root and your project is called awesome-project, you would write:
${workspace_loc:awesome-project}
Now you should have a valid launch configuration that you can use from both the Run and Debug menus. I sometimes rename these configurations to something noticeable right away e.g. "awesome-project TEST".

How do I add a blank line in an unix man page using groff?

I tried the following and it doesn't work:
.SH ADD A NEW TEST
Everytime you invoke a command within the shell,
this is what actually happens: the shell search for a folder
named as your command inside the directory
.B path/to/framework/Tests
or any subfolder,
if it finds such a folder, it will search for a file called
main.pl and will launch it.
.br
.br
Adding a new test is easy as create a new folder, put a main.pl
file inside it and invoke the folder name. Of course, for a better
integration with the whole system you should follow
some guide lines. Invoke the command
.B skeleton
to find out where the skeleton file is installed in your
system. Have a look to that file. It's well commented and
cover all possibile case and scenarios. Use it as a model to write
your own test.
The second .br is simply ignored.
I was able to accomplish it by using .PP when a paragraph begins.
.SH ADD A NEW TEST
.PP
Everytime you invoke a command within the shell,
this is what actually happens: the shell search for a folder
named as your command inside the directory
.B path/to/framework/Tests
or any subfolder,
if it finds such a folder, it will search for a file called
main.pl and will launch it.
.PP
Adding a new test is easy as create a new folder, put a main.pl
file inside it and invoke the folder name. Of course, for a better
integration with the whole system you should follow
some guide lines. Invoke the command
.B skeleton
to find out where the skeleton file is installed in your
system. Have a look to that file. It's well commented and
cover all possibile case and scenarios. Use it as a model to write
your own test.