How to set source on windows?

71 views
Skip to first unread message

Michael Andrews

unread,
Sep 12, 2014, 3:45:17 PM9/12/14
to nod...@googlegroups.com
So I'm trying to install openbadges following this tutorial, this part specifically

The problem I have is it tells me I need to set the source, but I don't know how to do that on a windows machine. I've tried

Node
source env_local

but it just gives me this

I'm new to node so sorry if it's a dumb question. But how do I set the source, so I can run that db migrate command?

Ryan Graham

unread,
Sep 13, 2014, 6:47:37 AM9/13/14
to nodejs
source is a *nix (or POSIX maybe?) shell command that reads the file (env_local in this case) and runs it in the current shell.

It's been so long since I used Windows that I don't know if Windows has an equivalent. What you could do instead is set the environment variables directly yourself with SET.

The example gives a bunch of lines starting with "export". Run each of those lines as a command, but replace "export" with "SET". Then run the migration command in the same terminal.

You could also replace that file with a .bat script, but I'll refrain from saying how to do that because I don't want to confuse anyone if I remember it wrong.

~Ryan

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/41a5abea-75be-430f-be95-b9a7415cf22d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
http://twitter.com/rmgraham

Ryan Schmidt

unread,
Sep 13, 2014, 6:48:10 AM9/13/14
to nod...@googlegroups.com
"source" is a command of the Bash shell, and other shells you find on Unix operating systems, which runs the specified shell script in the same environment as the current shell.

If you have a script file named "env_local", running it with "bash env_local" or "./env_local" would cause it to run in a *new* shell, in a *new* environment, which would go away as soon as the script exited. This is great for standalone programs because it means the script cannot pollute your environment, however sometimes you *want* the script to modify your environment; sometimes the script's entire purpose is to modify your environment, as is the case with the "env_local" script the above wiki page is helping you create; that's where use use "source"; e.g. "source env_local".

BTW, the command "." is an alias for the command "source" so you can accomplish the same thing by running ". env_local".

I don't know if there is a Windows equivalent of the "source" command, but even if there is, it's unlikely that a script that's compatible with Bash would also be compatible with the Windows shell.

You may need to ask the developers of this project whether it can be used on Windows, and if so, how.


Alexis Nelson

unread,
Oct 19, 2014, 4:41:19 PM10/19/14
to nod...@googlegroups.com
For anyone wandering, this works from the command line. So, replace export with SET and rename the file as a .bat and run it (without the "source") it'll work a treat.
Reply all
Reply to author
Forward
0 new messages