0

in my ~/.ackrc I have this line:

--type-add=javascript=.pkg

Now when I try to run ack foo I get an error:

$ ack foo
ack: --type-add: Type "javascript" does not exist, creating with ".pkg" ...

What does this mean? and how do I fix it.

Andy Lester
  • 91,102
  • 13
  • 100
  • 152
chovy
  • 72,281
  • 52
  • 227
  • 295

3 Answers3

1

--type-add means "Add .pkg to the list of known javascript extensions". The "add" here refers to the extension, not the type. You have the warning because there is no type called "javascript".

If you want to create a new file type called "javascript" then use --type-set=javascript=.pkg.

If you want to add .pkg to the list of extensions recognized by the existing js type, use --type-add=js=.pkg.

Andy Lester
  • 91,102
  • 13
  • 100
  • 152
0

It needs to be 'js' not 'javascript' no wonder i couldn't find it anywhere in their docs:

--type-add=js=.pkg
chovy
  • 72,281
  • 52
  • 227
  • 295
0

Your problem is that --type-add is for extending existing types; in order to create a new type, you have to use --type-set, like so:

--type-set=javascript=.pkg