comparison libervia/server/tasks/implicit/task_sass.py @ 1434:2f6dac783c8e

tasks(js_modules, sass): remove support for `npm`: `npm` cause trouble during installation, and it will be resource cousuming to find the source and maintain it in addition to `yarn`, thus `yarn` is for now kept and the only supported NodeJS package manager.
author Goffi <goffi@goffi.org>
date Wed, 09 Jun 2021 16:50:07 +0200
parents 10748aa888a9
children 106bae41f5c8
comparison
equal deleted inserted replaced
1433:1a5410981c45 1434:2f6dac783c8e
1 #!/ur/bin/env python3 1 #!/ur/bin/env python3
2 2
3 import json 3 import json
4 from pathlib import Path
5 from sat.core.i18n import _
6 from sat.core.log import getLogger 4 from sat.core.log import getLogger
7 from sat.core import exceptions 5 from sat.core import exceptions
8 from libervia.server.constants import Const as C
9 from libervia.server.tasks import task 6 from libervia.server.tasks import task
10 7
11 8
12 log = getLogger(__name__) 9 log = getLogger(__name__)
13 10
44 if 'node-sass' not in package.setdefault('dependencies', {}): 41 if 'node-sass' not in package.setdefault('dependencies', {}):
45 package['dependencies']['node-sass'] = 'latest' 42 package['dependencies']['node-sass'] = 'latest'
46 with package_path.open('w') as f: 43 with package_path.open('w') as f:
47 json.dump(package, f, indent=4) 44 json.dump(package, f, indent=4)
48 45
49 cmd = self.findCommand('yarnpkg', 'yarn', 'npm') 46 cmd = self.findCommand('yarnpkg', 'yarn')
50 await self.runCommand(cmd, 'install', path=str(d_path)) 47 await self.runCommand(cmd, 'install', path=str(d_path))
51 48
52 self.WATCH_DIRS = list(sass_dirs) 49 self.WATCH_DIRS = list(sass_dirs)
53 50
54 async def onDirEvent(self, host, filepath, flags): 51 async def onDirEvent(self, host, filepath, flags):