I am using a setup on Xcode that runs the following script for SwiftLint
if which $PATH/swiftlint >/dev/null; then
$PATH/swiftlint
elif which $HOME/.brew/bin/swiftlint >/dev/null; then
$HOME/.brew/bin/swiftlint
elif which ~/Softwares/homebrew/bin/swiftlint >/dev/null; then
~/Softwares/homebrew/bin/swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
I am unable to use pods or brew.
To make SwiftLint available I added the following to my path by using
vim ~/.bash_profile
export PATH
export PATH=$PATH:/Users/me/Documents/SwiftLint
and I can now access SwiftLint everywhere through the command line.
However, Xcode still displays the message that SwiftLint is not installed.
I can't use another method to install Swiftlint or change the script. I guess there is a problem with my export path - what is it?
When running scripts, .bash_profile will not be considered. I would just prepend your script like this:
if test -d "${HOME}/Documents/SwiftLint"; then
PATH="${HOME}/Documents/SwiftLint:${PATH}"
fi
export PATH
if ! which swiftlint >/dev/null 2>&1; then
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint" >&2
fi
You could just export the path to system-wide variables.
Steps to do
open Terminal
run command open .zshrc
add export PATH="${HOME}/Documents/SwiftLint:${PATH}"
Save and close
Related
I was setting up DWM window manager on debian, but when conpiling it, it came up with an error.
I installed it, then tried to run it with make clean install, but it did not have the make command. I installed it with sudo apt-get install -y make. I tried to run make clean install, but it came up with the error:
make: cc: No such file or directory
make: *** [Makefile:18: drw.o] Error 127
Help?
Doing just make install (sudo if required) the first time should fix the error.
As to why it happens — you probably have a custom Makefile or your rm binary does not understand the -f flag. The upstream Makefile has the following under the clean target:
clean:
rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz
Ensure that your Makefile also passes the -f flag to rm (which means "ignore nonexistent files").
I installed swiftlint through brew
brew install swiftlint
verified successfull installation through
swiftlint --version
0.50.1
Added script to project
export PATH="$PATH:/opt/homebrew/bin"
if which swiftlint >/dev/null; then
echo "SwiftLint started"
swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
Also i have:
root project:
-> .swiftlint.yml
When i'm trying to build project I'm getting
Tried also
swiftlint lint --config project/.swiftlint.yml
Update:
After several mac restarts somehow after time it is fixed
Update: After several mac restarts somehow after time it is fixed
I'm working in vscode, and I want to build the chromium in tasks.json, but the build shell report error command not found. I use echo $PATH to see the environments variables in tasks.json. It seems like the build shell in vscode doesn't execute source ~/.bashrc, so it can't find environment variable, but the terminal in vscode is in working order. Could someone help me?
I had the same issue and fixed it with the solution below
Solution For OSX with ZSH
Add a new file under /usr/local/bin/zsh-with-rc
#!/usr/bin/env zsh
source ~/.zshrc
/bin/zsh $#
Then run
chmod +x /usr/local/bin/zsh-with-rc
In settings.json add:
"terminal.integrated.automationProfile.osx": {
"path": "/usr/local/bin/zsh-with-rc",
}
Solution For Linux With Bash
Add a new file under /usr/local/bin/bash-with-profile
#!/usr/bin/env bash
source ~/.bash_profile
source ~/.bashrc
/bin/bash $#
Then run
chmod +x /usr/local/bin/bash-with-profile
In settings.json add:
"terminal.integrated.automationProfile.linux": {
"path": "/usr/local/bin/bash-with-profile",
}
Add "terminal.integrated.shell.linux": "/bin/bash" in settings.json
For a school assignment, I am trying to compile a C file using a provided Makefile in Vscode. The makefile contains the following:
CFLAGS += -std=gnu11 -g
EXES = greet
all: $(EXES)
clean:
rm -f $(EXES)
greet: greet.c
# don't treat all and clean as file targets
.PHONY: all clean
When I run make in the VScode terminal, it gives me:
bash: make: command not found
Why is this happening? The assignment says this:
The accompanying Makefile will build the program greet. Thus, you can compile the
program by running make. The make program will print out each command that it uses to
compile the program. Note that if you run make twice in a row, the second time it won’t do
anything, because it knows your source file hasn’t changed.
Run the program using the following command:
./greet
I don't know if this has anything to do with my tasks.json file in VScode?
I also ran across this VSCode extension: https://naereen.github.io/Makefiles-support-for-VSCode/
It says Vscode now has something built-in: https://github.com/microsoft/vscode/tree/master/extensions/make
I don't know how to install this.
The instructions for madge are only good for a linux system (it requires sudo to get the command line part set up). Is there a way to run it on windows?
It turns out to be very simple. To install madge:
npm install madge
Then to set it up for the command line:
npm -g install madge
You can then run it with a command of:
madge
For typescript generate .js files do:
madge -f amd -c .
and you'll get the circular report. You need the "-f amd".