I'm using Grunt task runner to build a web app on Windows 8.1, and have JShint task for checking Javascript. The Gruntfile was generated using the Webapp generator.
When JSHint detects an error, the output generated in the terminal window is colored navy blue - which is very difficult to read against the black background color of the terminal window.
I have tried to change the background color to something else, but while it fixes the JShint output, it makes other output hard to read.
So my question is; how do I change the color of the JSHint output?
I found this question when trying to do the same thing. One thing that you can try is using the no-color flag. Run like this:
grunt jshint --no-color
Related
From version 0.33.1 onwards, aws-sam-cli supports colored output. I'm trying to run the sam deploy command from Jenkins pipeline and the output is not displaying in colored format. I've installed ANSIColor Jenkins plugin and wrapped the sam deploy command with ansiColor('xterm') {}. The command works as expected and the Cloudformation stack is getting created. The concern is the output is not in colored format.
node {
stage('Example') {
ansiColor('xterm') {
sh "sam deploy --parameter-overrides ${someparameter} --template-file ${templatefile} --stack-name ${stackname} --capabilities CAPABILITY_NAMED_IAM --no-fail-on-empty-changeset --no-execute-changeset"
}
}
}
In order to verify my Jenkins, I tried test-snippet in Jenkins and it displayed the colored output.
ansiColor('xterm') {
stage "\u001B[31mI'm Red\u001B[0m Now not"
}
So Jenkins is able to display ANSI color, but the aws-sam-cli output is not in colored format.
Any ideas or pointers would be helpful.
aws-sam-cli uses click library to format its output, including color handling.
The documentation for click explains why you're seeing what you're seeing:
Starting with Click 2.0, the echo() function gained extra
functionality to deal with ANSI colors and styles. [...]
Primarily this means that:
Clickâs echo() function will automatically strip ANSI color codes if the stream is not connected to a terminal.
This is a typical behavior of most programs, however some programs allow overriding this, usually with --color parameter.
In your case, I'd suggest asking for an enhancement on click's issue tracker.
Edit: There's already been one.
I am trying to use gulp to copy some JS/CSS from node_modules to wwwroot in an ASP.Net core app.
I have what I thought was a fairly simple gulpfile.js
var gulp = require('gulp');
gulp.task('copy-files', function () {
var assets = {
js: [
'./node_modules/bootstrap/dist/js/bootstrap.js'
],
css: [
'./node_modules/bootstrap/dist/css/bootstrap.css'
]
};
_(assets).forEach(function (assets, type) {
gulp.src(assets).pipe(gulp.dest('./wwwroot/' + type));
});
});
However, when I look at the VS Task Runner, it just shows an error:
But the output window is empty:
How can I get more information about the error?
This answer here worked for me.
Moved up the $(PATH) location above everything. As I did not have (DevEnvDir)|Extensions\Microsoft\Web Tools\External location as mentioned in the answer.
For VS 2015
Tools > Options > Projects and Solutions > External Web Tools
For VS 2017
Tools > Options > Projects and Solutions > Web Package Management > External Web Tools
The problem is not related to path, but actually there must be some problem with gulp file itself either syntax error or some package is missing which unfortunately visual studio does not show that specific error but generic error what you see in task runner "failed to load". And the right way to see the errors is
Open the command prompt (preferably in admin mode, this is what i did).
Goto the same location where gulp file is located.
Run the task through following command example --> gulp default
If there is any error like package is missing, it will show you, fix those issues.
After all errors are fixed, then you will see that gulp task runs successfully.
Go back to visual studio, task runner, and click on refresh (left top button), and it will show you all tasks.
screenshot?
I'm not sure why but opening a cmd prompt at the directory containing gulpfile.js and running npm install has fixed it.
Perhaps someone wiser than I can explain why.
In Output window, make sure you select Task Runner Explorer for Show output from option. This was my problem why I didn't see the error logs from gulpfile. A rookie mistake.
I'm using Visual Studio Community 2019 Version 16.5.4.
I had the same problem and found the answer in the next link:
https://developercommunity.visualstudio.com/content/problem/961170/gulpfile-fails-to-load-after-upgrading-to-vs2019-1.html
Gulp uses node.js but it is important the version to be compatible. I've tried few versions and at the end version 0.12.7 works for me. But had to place absolute path to the place where that node version is installed in VS
Tools > Options > Projects and Solutions > External Web Tools
and move the path to the top. Placing the Path in environment variables and moving $(PATH) to the top didn't help in my case.
I cannot find a suitable solution for my needs with running a Go project inside a Sublime Text 3 and seeing it's output in real-time.
If I try a build system from:
GoSublime - I can use run, it even runs and stops, but there is no output, which I need. It appears only when I cancel build - it's too late.
Official Golang Build from Go developers - I can build the project, and that's it. It allows to run 1 file (current) only, but I need the whole project.
I've tried to use flags for run command and to add *.go, but then I get *.go: no such file or directory
How do I see the output in real-time in one of these solutions? I've tried to create my own build system with shell_cmd = go run *.go, but stopping the process with Cancel build is not working then. Maybe you can explain how do I stop a running Go program? My mybuild.sublime-build is similar to this:
{
"env": {
"GOROOT": "/path/gosrc/go",
"GOPATH": "/path/godev"
},
"path": "$PATH:/path/gosrc/go/bin",
"working_dir": "/path/godev/src/github.com/user/program",
"cmd": "go run *.go",
"shell": true
}
..I can run Build and see the needed output, but how do I then stop a running process?
P.S. Program is not just executing and exiting - it's a service, so I should see the output when the needed actions happens.
I personally use GoSublime and go build . followed by running the app by name as a second command. Obviously this sucks in a lot of ways, but it kinda sorta works most of the time. It provides a nice fast way to check for compile errors, which is most of what I need.
Honestly, just running in a dedicated shell is nicer in every way.
AFAIK, there is no better Go build system available for Sublime Text (that isn't an endorsement, it sucks, just less than most).
I found a tutorial where I was able to run Go files on build in Sublime Text 3 here: https://www.alexedwards.net/blog/streamline-your-sublime-text-and-go-workflow
If you use Build With: Go - Run you get outputs, but if you are running for example a net/http local host in Go you won't be able to run multiple programs and cancel build also does not work.
Here is an example of simple fmt.Println output in Sublime Text 3:
> Environment:
> GOPATH=C:/Users/Christiaan/go
> Directory: C:\Users\Christiaan\Documents\02_Personal\04_Learning\09_Go\01_test
> Command: C:\Users\Christiaan\go\go1.15rc1\bin\go.exe run -v C:\Users\Christiaan\Documents\02_Personal\04_Learning\09_Go\01_test\test2.go
> Output:
command-line-arguments
gas_pedal: 22314 brake_pedal: 0 steering_wheel: 12562
> Elapsed: 3.856s
> Result: Success
I am using Laravel Elix and Gulp (on Windows 8) to combine and compile my Angular.js and SCSS files. Se the code bellow:
var elixir = require('laravel-elixir');
require('./tasks/angular.task.js');
require('./tasks/bower.task.js');
require('laravel-elixir-livereload');
elixir.config.js.outputFolder = 'public/js/';
elixir(function(mix){
mix
.sass('app.scss')
.bower()
.angular('resources/assets/angular/');
});
The problem is that when I am running gulp watch the combined all.js file will not update until i click the terminal window (give it focus). It's showing that the gulp has finished the task:
[13:26:45] Finished 'angular in resources/assets/angular/' after 26 ms
After reading previous comments, I think there's still a solution that's available to use, if willing:
Going to System Settings under the Synchronization section you can set the file save on a timer when application is idle.
That way you'll have the watcher run as expected while you're typing.
The Setup:
Using scss-lint plugin for IntelliJ-based IDEs (PHPStorm)
http://plugins.jetbrains.com/plugin/7530?pr=phpStorm
A gulp-compass task, part of a larger Gulp build process, that watches my sass (scss) dir.
https://www.npmjs.com/package/gulp-compass
NOTE:
OS: Windows 8
both tools work as expected.
The Situation:
With the scss-lint inspection active, any kind of typing activity in the editor (including simply typing a whitespace) triggers the gulp-compass task, and the terminal for said task returns 'file not found' errors along the following line:
[10:53:34] Starting 'dev-compass'...
[10:53:34] Finished 'dev-compass' after 3.58 ms
[10:53:36] File not found: E:/projects/xf/src/sass/blog_scsslint_tmp8349313806557714816.scss
[10:53:36]
[10:53:36] { [Error: Compass failed]
message: 'Compass failed',
showStack: false,
showProperties: true,
plugin: 'gulp-compass',
__safety: { toString: [Function] } }
[BS] 1 file changed (blog.css)
[10:53:46] Starting 'dev-compass'...
[10:53:46] Finished 'dev-compass' after 15 ms
write src/styles.group/blog.css
[BS] 1 file changed (blog.css)
Note: this 'error' doesn't prevent the task to perform; when I make actual changes to the .scss source files, the .css are generated properly.
Apparently, either SCSS Lint itself and/or the PHPStorm plugin generate temporary files when the inspection occurs, and promptly removes them -- presumably when the inspection finishes.
As it does so in the same directory that's being watched by the gulp-compass task... These two end up playing NYSMNYD (now you see me, now you don't).
I was hoping I could either:
set my SCSS Lint configuration file to force a different path for the temporary files, or,
set my gulp-compass task to ignore files based on a pattern such as *scsslint_tmp*.scss
But so far, I haven't found any way to do either of these.
I suppose it could be seen as just a 'cosmetic' error, since both tools do produce the desired outputs, but it results in unnecessary processing, and by filling my terminal with 'bogus' errors just make it more confusing to spot the genuine ones.
Any ideas?