LoginSignup
3
0

More than 5 years have passed since last update.

プロジェクト内のJavaScriptを厳格にするシェル

Last updated at Posted at 2017-01-04

カレントディレクトリ内の全ての*.jsファイルの先頭に"use strict"を挿入します。

全てのJSファイルに対してforを回す

for f in **/*.js; do sed -i '1i"use strict"' $f ; done

Gitで管理されてるファイルのみなら以下の書き方のほうがいい

for f in git ls-files **/*.js; do sed -i '1i"use strict"' $f ; done
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0