-1

I had been using "make" to save my source code (I had been using an online IDE which had "make" available to me) and compile it all in one, but when I moved to a local version of VS Code, I found that "make" did not work without installing it (I was prompted to install it).

This got me wondering if there is any smaller (i.e. less inclusive?) command that just or pretty much just saves source code, which I can use prior to using "cc" to compile in the terminal, rather than using "make" to both save changes to my source code and then compile it (I assume "make" saves and compiles the source code given that I did not have to manually save changes to my source code when using an online version of VS Code, as I do now using VS Code locally).

As of right now I am just manually saving via VS Code using the GUI, but I'd like to find a way to do this just in the terminal. If I just use "cc" after making changes to my source code, it just compiles the previously saved version (which was saved using the GUI and not the terminal).

Thank you!

Redtunic
  • 25
  • 4
  • 2
    The purpose of _make_ is not to do backups, and `make` by itself doesn't do it, although with a suitable **makefile** (which you would have to write by yourself), you can use _make_ for creating backups as well. A more typical program for doing backups would be `rsync`, and of course you **can** invoke `rsync` from within a makefile, if you want to have everything in one place. – user1934428 Jul 12 '22 at 07:58
  • There is no way short of some plugin interface or api to tell *visual studio* to save its work "from the terminal". I suspect what you were observing was a side effect of clicking a button marked "make" inside an ide. – 2e0byo Jul 12 '22 at 08:12
  • OTOH if you want a built in way to do everything from the terminal there's always vi... – 2e0byo Jul 12 '22 at 08:13

1 Answers1

-1

In VS Code Online autosave is on.

In VS Code local you can set up autosave. This shows how:
Auto-saving files upon changes with Visual Studio Code
Or here from Microsoft:
https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save

Simon
  • 106
  • 1
  • 6