Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'cp' is not recognized as an internal or external command

I tried to run a project using custom build in FlashDevelop:

$(CompilerPath)\haxe.exe $(ProjectDir)\compile-js.hxml

, but I get this error:

'cp' is not recognized as an internal or external command,

here is the compile-js.hxml file, is there any idea how to solve this?

compile-js.hxml

#sources
-main Cocktail
-cp ../../src/
-cp src

#binary
-js bin/js/Main.js
--macro Cocktail.create('src/index.html','Main')

#copy assets directory
-cmd cp -R assets bin\js\
like image 818
simo Avatar asked Feb 10 '13 11:02

simo


People also ask

Is cp an internal command?

'cp' is not recognized as an internal or external command, operable program or batch file. This error is occurred due to the cp command is not available in windows os. It is only available in Linux based operating systems.


2 Answers

I'm guessing if you're on Flashdevelop, you're running Windows, and if you're running windows, there's no such thing as the 'cp' command. When haxe has finished building your Javascript, it gets to the -cmd line and attempts to run cp -R assets bin\js\, which will fail because windows doesn't have cp, it has copy.

For Windows, try changing the last two lines to something like:

#copy assets directory
-cmd copy \y assets bin\js\

** Disclaimer: I'm not in Windows at the moment, so am not certain about the exact syntax of the Copy command. But you get the idea.

like image 76
Jason O'Neil Avatar answered Sep 22 '22 17:09

Jason O'Neil


Stolen from Here :)

if you're running on windows you have to replace "cp" with "copy"

like image 38
Vineesh TP Avatar answered Sep 18 '22 17:09

Vineesh TP