Skip to content
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

LibreJS license comment missing #99

Closed
theel0ja opened this issue Sep 17, 2018 · 3 comments
Closed

LibreJS license comment missing #99

theel0ja opened this issue Sep 17, 2018 · 3 comments

Comments

@theel0ja
Copy link

Guide: https://www.gnu.org/software/librejs/free-your-javascript.html

screen shot 2018-09-17 at 16 51 30

Releated to this file:

anchorjs/banner.js

Lines 1 to 17 in ac306bc

const fs = require('fs');
const pkg = require('./package.json');
const filename = 'anchor.min.js';
const script = fs.readFileSync(filename);
const padStart = str => ('0' + str).slice(-2)
const dateObj = new Date;
const date = `${dateObj.getFullYear()}-${padStart(dateObj.getMonth() + 1)}-${padStart(dateObj.getDate())}`;
const banner = `/**
* AnchorJS - v${pkg.version} - ${date}
* ${pkg.homepage}
* Copyright (c) ${dateObj.getFullYear()} Bryan Braun; Licensed ${pkg.license}
*/
`;
if (script.slice(0, 3) != '/**') {
fs.writeFileSync(filename, banner + script);
}

@bryanbraun
Copy link
Owner

bryanbraun commented Nov 30, 2018

Wow, I didn't know this was a thing.

I could see us doing this. As such, I'd prefer to use the "magnet link form" so I don't have to include the full text of the license in a minified file. According to Wikipedia, I use the "Expat" variation of the MIT license, so I think it would look like this:

/** 
  * AnchorJS - v4.1.1 - 2018-07-01
  * https://github.com/bryanbraun/anchorjs
  * Copyright (c) 2018 Bryan Braun; Licensed MIT
  */ 
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT
... [script is here] ...
// @license-end

Does that look right to you, @theel0ja?

@theel0ja
Copy link
Author

Yes.

@bryanbraun
Copy link
Owner

bryanbraun commented Dec 1, 2018

Cool, just tested it out and (with a few adjustments) it's working great:

image

Pushing up the commit now. The license reference will get added to the next published version 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants