Gibt es eine Möglichkeit, die Eingabeaufforderung zu öffnen und Grunt Watch von meinem Projektverzeichnis jedes Mal starten, wenn mein PC startet? Nur um die Automatisierung zu automatisieren, haben sie eine gute halbe Stunde damit verbracht, ohne Glück zu googeln.Run grunt watch aus dem Startfenster 10
0
A
Antwort
0
Es gibt ein Modul, das ein Knotenscript als Windows-Dienst installiert, es heißt Node-Windows (npm, github, Dokumentation). Ich habe es schon mal benutzt und arbeitete wie ein Zauber.
var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service({
name:'Hello World',
description: 'The nodejs.org example web server.',
script: 'C:\\path\\to\\helloworld.js'
});
// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install',function(){
svc.start();
});
svc.install();
es installieren:
npm install -g qckwinsvc
Ihren Dienst installieren:
> qckwinsvc
prompt: Service name: [name for your service]
prompt: Service description: [description for it]
prompt: Node script path: [path of your node script]
Service installed
Ihren Dienst deinstallieren:
> qckwinsvc --uninstall
prompt: Service name: [name of your service]
prompt: Node script path: [path of your node script]
Service stopped
Service uninstalled