maybe you can extract the part until `grep '\.js$'` to another var, because I see it's used several times