Open nswitanek opened 9 years ago
This is almost certainly a Windows issue, and I’m afraid I won’t be much help at solving it. My guess from the cryptic error is that it’s failing inside the gitCommit
function:
function gitCommit(callback) {
child.exec("git commit --allow-empty -m 'Initial gistup commit.'", function(error, stdout, stderr) {
if (!error && stderr) process.stderr.write(stderr), error = new Error("git commit failed.");
if (!error && stdout) process.stdout.write(stdout);
callback(error);
});
}
Specifically, it looks like your shell is not correctly parsing the single-quoted commit message (Initial gistup commit.
) and is instead passing gistup
and commit.'
as separate arguments to git
. Which of course fails.
It’s possible that gistup could be modified to support Windows, but my guess is that this would require substantial changes. So you might be out of luck. Sorry. :frowning:
Understood. Thanks very much for your swift reply.
I can bypass the mentioned error https://github.com/mbostock/gistup/issues/22#issue-90510743 using underscores like so
function gitCommit(callback) {
child.exec("git commit --allow-empty -m 'Initial_gistup_commit'", function(error, stdout, stderr) {
if (!error && stderr) process.stderr.write(stderr), error = new Error("git commit failed.");
if (!error && stdout) process.stdout.write(stdout);
callback(error);
});
}
Ok it is creating the Gist on GitHub in MINGW64 using https://github.com/mbostock/gistup/tree/c6f3b193de8a99f6275496ec2dd6761b57c3e598
So a note to myself https://github.com/CrandellWS/gistup/commit/ac982d14359cc529f5bf01c58fd4f728952e501c from where I had not realized there was a problem with ssh (had not even tried yet, thought it was setup but do to custom naming convience...)
Got this much figured out from https://gist.github.com/leommoore/4484379#passing-environment-variables
function gitTestWin(callback) {
var env = process.env,
varName,
envCopy = {};
// Copy process.env into envCopy
for (varName in env) {
envCopy[varName] = env[varName];
}
envCopy['wtf'] = 'It is a win thing';
child.exec("echo %wtf%", { env: envCopy}, function(error, stdout, stderr) {
if (!error && stderr) process.stderr.write(stderr), error = new Error("It has failed.");
if (!error && stdout) process.stdout.write(stdout);
if(error){
console.warn(error.message);
}
console.warn('EXIT');
process.exit(1);
});
}
Cross platform??>
var env = process.env,
varName,
envArgv,
envCopy = {};
// Copy process.env into envCopy
for (varName in env) {
envCopy[varName] = env[varName];
}
envCopy['wtf'] = 'It is a win thing';
if(process.platform === "win32") {
envArgv = "%wtf%";
} else {
envArgv = "$wtf";
}
child.exec("echo " + envArgv, { env: envCopy}, function(error, stdout, stderr) {
Here is what I have got so far https://github.com/CrandellWS/gistup/commit/6114d26d98d70968176975b094f2af86d5e4973c
Though it looks like more can still be done.
With Windows this works
function gitCommit(callback) {
child.exec('git commit --allow-empty -m "Initial gistup commit"',function(error, stdout, stderr) {
if (!error && stderr) process.stderr.write(stderr), error = new Error("git commit failed.");
if (!error && stdout) process.stdout.write(stdout);
callback(error);
});
}
vs this fails
function gitCommit(callback) {
child.exec("git commit --allow-empty -m 'Initial gistup commit.'", function(error, stdout, stderr) {
if (!error && stderr) process.stderr.write(stderr), error = new Error("git commit failed.");
if (!error && stdout) process.stdout.write(stdout);
callback(error);
});
}
do not have current access to linux but it is assumed that there is reason to not just change it like mentioned if only because the message might contain unwanted character and what not...
bit stuck on Right single quotation mark (U+2019) vs. Apostrophe (U+0027) not sure what to do
deferred to
child.exec('git config --get remote.' + crossPlatform.envVal('remoteName') + '.url || '+ crossPlatform.rEcho(),{ env: crossPlatform.newEnvVal('remoteName', argv.remote)}, function(error, stdout, stderr) {
now you can see the rEcho (returned echo) in cross-platform.js this newer update partially works in MinGW and cmd.exe https://github.com/CrandellWS/gistup/commit/010814e68d97f9515c3870eafc417111ca295fed
still got the file issue to consider https://github.com/mbostock/gistup/issues/21
Can Someone test this on a linux system for me
Windows users will hopefully find success using:
npm install -g mkg
The previous package was renamed to mkg so use npm install -g mkg
to install.
Was able to get Ubuntu up and running to test the package and found it is now successfully working.
A side note for Ubuntu users getting npm running was not so straight forward. For my purposes the Best Solution To get npm working correctly on Ubuntu:
ln -s
which nodejs~/bin/node
This issue is fixed with the solution CrandellWS provided. Thanks @CrandellWS
Hi,
I've followed the "Let's Make a Block" tutorial and gotten stuck trying to run gistup. I've pasted the error below, which isn't addressed in your gistup troubleshooting section. At first I thought it might be a git configuration issue, but it looks like I've not set up my path variables correctly for npm-installed programs to run. Will check that first.
Thank you.