gopherjs / gopherjs.github.io

GopherJS Playground
https://gopherjs.github.io/playground/
23 stars 12 forks source link

Stop relying on non-standard `rename` in update.sh. #43

Closed dmitshur closed 8 years ago

dmitshur commented 8 years ago

This is a smaller task extracted from #36:

  • It requires rename command, which can be acquired with brew install rename but if possible, it'd be better not to require it. It can be replaced with a < 50 line Go program inside the repo, that way no external dependencies are needed.

@dominikh also wrote about the downsides of relying on this command in https://github.com/gopherjs/gopherjs.github.io/pull/41#discussion_r53561630:

rename isn't a standard POSIX tool, and different Linux distributions ship different tools (with entirely different interfaces) under that name. For example, on my system, rename looks like this: rename [options] expression replacement file..., and the patterns look like shell globs, not like regular expressions. On my system, your version of rename would be perl-rename.

This should probably be written with find -exec instead.

This issue is to track that.

dominikh commented 8 years ago

find "$PKG" -name "*.a" -exec sh -c 'mv $0 $0.js' {} \;