I have a project that create once on linux
at now I work on it on windows os and I have a command to minify assets file; my problem is "\r\n"
in output create new line add cause to different files with previous version, for example if we have :
});console.log("test");
command output is :
});
console.log("test");
Can you help me?
Your IDE should be able to set the line separator. At least Atom, IntelliJ, notepad++ and others support this feature.
git itself has a feature to fix/change line feeds. See git-scm on autocrlf and this SO question and its answers.
Related
Using windows my code I currently use:
var file = JSON.parse(fs.readFileSync(filePath), 'utf8');
file[id] = JSON.parse(`{"name":name}`);
fs.writeFileSync(filePath, JSON.stringify(file,null,2);
This works just fine on windows. However, when I transfer this code onto my linux machine for cross-platform testing. The file doesn't get updated until I stop running the application.
What i've tried:
running 'chmod -r 0777 path/to/dir/'
and
checked if it was due to max file open limit (not the case as my limit is extremely large)
Linux: Mint-Linux 4.10.0-38-generic #42~16.04.1-Ubuntu (from uname -a)
Node: 8.10.0
Editor: intelliJ idea
Im also running the code directly from the run button in intelliJ, im not sure if this may be the cause, if it is the cause why would this be the case.
Adding the option {mode: 0o777} as the last arg in the write fixed the files not updating.
I have the same problem as discussed here: Apache caching javascript assets?. but, in my case, the problem persists.
Host windows 8.1
Vagrant Guest: Centos 6.6 32bits
I had uncommented those lines in /etc/httpd/conf/httpd.conf:
EnableMMAP off
EnableSendfile off
Restart Apache
But the issue persists.
My changes weren't appearing and special characters were being added to the end of the file.
Thanks!
Problem solved
Problem:
I was editing my files with sublimetext2 from windows host and saving those with Windows line endings
Then linux guest served js files with wrong ending
Solution:
I changed lines ending to unix in sublimetext2
Fixing Sublime Text 2 line endings?
Thanks
I am creating an add-on for Mozilla.
I have seen that if I know the path of a file, I can execute it by spawning the process.
But is it possible to execute system commands like "ls", "dir", "javac" etc. from my mozilla add-on directly?
Thanks in advance.
Edit:
I have found a way to run .bat and .sh file in windows and Linux through my Mozilla Add-on using javascript. But is there a way to run .sh file in Mac?
Below I have mentioned some code to show how I am doing that for Linux.
var exefile = Components.classes["#mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
/**
* Path to terminal file.
* I need same for Mac.
*/
exefile.initWithPath("/usr/bin/gnome-terminal");
var run = Components.classes['#mozilla.org/process/util;1'].createInstance(Components.interfaces.nsIProcess);
run.init(exefile);
var parameters = ["-e", path_of_shell_script]; //with arguments
run.run(false, parameters,parameters.length);
I am not into these kind of concepts. But the question is a bit intriguing. So, i peeped into it.
Well If you can call the file then you can call an batch file or shell script which will do the trick for you.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am going through AngularJS tutorials, and I am stuck on the tutorial for running Testacular tests. I get the following error:
Starting Testacular Server (http://vojtajina.github.com/testacular)
-------------------------------------------------------------------
info: Testacular server started at http://localhost:9876/
info (launcher): Starting browser Chrome
error (launcher): Cannot start Chrome
execvp(): No such file or directory
info (launcher): Trying to start Chrome again.
error (launcher): Cannot start Chrome
execvp(): No such file or directory
info (launcher): Trying to start Chrome again.
error (launcher): Cannot start Chrome
execvp(): No such file or directory
When I search for the problem, there are similar users that have this problem but they are using Windows. I am using Linux Mint.
It is just a small problem in config files' list of browsers. You should change the name of the browser in the configuration files under config/ directory: config/testacular.conf.js and testacular-e2e.conf.js.
If you are using chromium browser set the list of browsers to 'chromium-browse', instead of 'Chrome' like this.:
browsers = ['chromium-browser'];
Here is an ss of my testacular.conf.js file: .
If you would like to include more than one browser for you tests you can add the name of the other browsers installed in your system:
browsers = ['chromium-browser', 'firefox'];
If you are not sure about the name of your chrome browser this should help in the terminal:
ls /usr/bin/ | grep -i chrom
When I call window.open() from JavaScript, I get the error dialog with the message "Line: xxx Error: No such interface supported"
Google leads me to websites referring as far back as IE4 saying that I need to run regsrvr32 on several DLLs.
Is there a better solution?
EDIT: exact code requested
<html><head>
<script type="text/javascript">
function windowOpen() {
window.open("http://localhost/mysite/mypage.asp", "myWindowName", "");
}
</script></head>
<body>
<button onclick="windowOpen();return false;">Hi There</button>
</body></html>
EDIT2:
The provided answers all go back to IE4/Win95 days. I mean, seriously?? Regardless, I disabled Smooth scrolling in IE8 (!!!) and also attempted to register the controls listed in the kb article mentioned by Shoban, but got an error attempting to register shdocvw.dll (The module "shdocvw.dll" was loaded but the entry-point DllRegisterServer was not found. Make sure that "shdocvw.dll" is a valid DLL or OCX file and then try again.)
First of all, try just the following and see if the problem goes away:
OPTION 1
Step 1: Fix IE
Copy and paste the following in the command prompt running as an admin, then press :
"%systemroot%\system32\regsvr32.exe" "C:\Program Files\Internet Explorer\ieproxy.dll"
If you are running 64 bit windows, try this:
"%systemroot%\system32\regsvr32.exe" "C:\Program Files> (x86)\Internet Explorer\ieproxy.dll"
OPTION 2
If the above doesn't work, try the following two steps.
Step 1: Re-register all DLLs
Open a command prompt as an admin. Type the following command:
FOR /R C:\ %G IN (*.dll) DO "%systemroot%\system32\regsvr32.exe" /s "%G"
You will probably get some error windows popping up at this point, just ignore them all and close them when the command prompt stops churning.
Step 2: Fix IE
Copy and paste the following in the command prompt running as an admin, then press :
"%systemroot%\system32\regsvr32.exe" "C:\Program Files\Internet Explorer\ieproxy.dll"
If you are running 64 bit windows, try this:
"%systemroot%\system32\regsvr32.exe" "C:\Program Files> (x86)\Internet Explorer\ieproxy.dll"
Sources:
http://social.technet.microsoft.com/Forums/en-US/w7itproui/thread/99e4ab4f-165d-4691-90dd-ab41a05d26a2
http://forums.techguy.org/all-other-software/568737-solved-internet-explorer-wont-start.html
Check if there are any toolbar installed. I had the same problem and this caused because I run fiddler http debugging proxy
On Win10 x64 with IE11 this solved my problem:
regsvr32 "C:\Windows\SysWOW64\ieproxy.dll"