-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Subsystem Linux usage #5
Comments
I pushed these changes to master and still get the error but the link is being added |
This is failing here: netlify-shortener/src/index.js Line 40 in c66b19e
I'm not sure why it's not working for you but I'm guessing this is a clipboardy bug. Could you do a little digging to figure out what's going on there? |
It's an issue with WSL itself. There are some (weird) solutions though:
It seems |
Changing the index.js to this made it work on WSL: #!/usr/bin/env node
/* istanbul ignore file */
"use strict";
const fs = require('fs');
const path = require('path');
const { exec } = require('child_process');
const readPkg = require('read-pkg-up');
const {
format,
generateCode,
commitAndPush,
validateUrl,
validateUnique
} = require('./utils');
const {
pkg: {
baseUrl = 'https://update-baseUrl-in-your-package.json'
},
path: pkgPath
} = readPkg.sync({
cwd: path.join(__dirname, '../..')
});
const repoRoot = path.dirname(pkgPath);
const redirectPath = path.join(repoRoot, '_redirects');
const [,, longLink, code] = process.argv;
const short = `/${code || generateCode()}`;
const contents = fs.readFileSync(redirectPath, 'utf8');
let newContents = contents;
if (longLink) {
validateUrl(longLink);
validateUnique(short, contents);
newContents = `${short} ${longLink}\n${contents}`;
}
fs.writeFileSync(redirectPath, format(newContents));
commitAndPush(short, longLink, repoRoot);
const link = `${baseUrl}${short}`;
exec(`echo "${link}" | clip.exe`, (err, stdout) => {
if (err) {
console.log('Erorr copying the link into your clipboard')
return
}
console.log(`${link} has been copied to your clipboard`);
}); |
Closing, I'm working around the issue. |
netlify-shortener
version:1.0.3node
version:10.14.2npm
(oryarn
) version:6.4.1Relevant code or config
What you did: tried to run
shorten
for the npm scriptnetlify-shortener
What happened: got the following error output:
Reproduction repository: spences10/netlify-short-urls
Problem description: I'm using WSL so not sure if that is an issue or the fact that I'm on a feature branch and not master
Suggested solution: looking into CD settings on netlify now
The text was updated successfully, but these errors were encountered: