| 142 | logger.warn("webpack-cli is not installed, plugin will not work") |
| 143 | |
| 144 | def webpack_watch_process_count(): |
| 145 | count = 0 |
| 146 | try: |
| 147 | pids = [pid for pid in os.listdir('/proc') if pid.isdigit()] |
| 148 | for pid in pids: |
| 149 | try: |
| 150 | if "/usr/bin/webpack-cli" in open(os.path.join('/proc', pid, 'cmdline'), 'r').read().split('\0'): |
| 151 | count += 1 |
| 152 | except IOError: # proc has already terminated |
| 153 | continue |
| 154 | except: |
| 155 | logger.warning("webpack_watch_process_count is not supported on this platform.") |
| 156 | |
| 157 | return count |
| 158 | |
| 159 | |
| 160 | def register_plugins(): |