Get the version of installed acorn :rtype: str
()
| 230 | |
| 231 | |
| 232 | def get_acorn_version(): |
| 233 | """ |
| 234 | Get the version of installed acorn |
| 235 | :rtype: str |
| 236 | """ |
| 237 | proc = subprocess.Popen(['node', '-p', 'require(\'acorn/package.json\').version'], |
| 238 | stdout=subprocess.PIPE, stderr=subprocess.PIPE, |
| 239 | cwd=os.path.dirname(os.path.realpath(__file__))) |
| 240 | assert proc.wait() == 0, "Acorn is required to parse javascript files. " \ |
| 241 | "It was found on the path but could not be imported " \ |
| 242 | "in node.\n" + proc.stderr.read().decode() |
| 243 | return proc.stdout.read().decode().strip() |
| 244 | |
| 245 | |
| 246 | class Javascript(BaseLanguage): |