file-templates icon indicating copy to clipboard operation
file-templates copied to clipboard

Failed to load init file, process is not defined

Open sigmasoldi3r opened this issue 8 years ago • 3 comments

Tried to add a custom macro to the init file with no success, even after switching to JS:

proccess.fileTemplates = {
  macros: {
    year: () => {
      return new Date().getYear() + 1900;
    }
  }
};

This fires the next error:

image

sigmasoldi3r avatar Aug 23 '17 11:08 sigmasoldi3r

Ofcourse the first attempt was in coffescript

proccess.fileTemplates = {
  macros:
    foo: ->
      return new Date().getYear() + 1900
}

Fires the same error.

sigmasoldi3r avatar Aug 23 '17 11:08 sigmasoldi3r

Your second example is working. I don't know coffescript, but seems like first example has a syntax error in year: () => { So please check your Atom and file-templates versions to get second example working.

Mine: atom - 1.50.0 file-templates - 0.2.0

pavelsr avatar Dec 04 '20 10:12 pavelsr

@pavelsr The first example is in Es6 Javascript.

sigmasoldi3r avatar Dec 13 '20 20:12 sigmasoldi3r