child-process

remove image size & add image size in child theme funcions.php not working

拥有回忆 提交于 2020-07-09 11:42:09
问题 can anybody help with the following? I'm trying to alter the one of the custom thumbnail sizes produced by a theme in the child theme, i've added the following to functions.php in the child theme: add_theme_support( 'post-thumbnails' ); remove_image_size( 'sela-grid-thumbnail' ); add_image_size( 'sela-grid-thumbnail', 242, 242, true ); The original function from the paren theme is: add_theme_support( 'post-thumbnails' ); // Post thumbnails set_post_thumbnail_size( 820, 312, true ); // Hero

How can I run a shell command inside of a gulp task and detect when it's done?

假装没事ソ 提交于 2020-07-08 11:48:45
问题 I'm trying to run a shell command inside of a gulp task using child_process.spawn . I have to detect when the task is done running so I'm using stdout to check for a specific string that I emit at the end of the command, but for some reason it doesn't look like my string is being emitted: // gulp 3.9.1 var gulp = require('gulp'); var spawn = require('child_process').spawn; gulp.task('my-task', function(cb) { var command = ''; // construct my shell command here var end = 'end_of_command'; var

How can I run a shell command inside of a gulp task and detect when it's done?

 ̄綄美尐妖づ 提交于 2020-07-08 11:48:07
问题 I'm trying to run a shell command inside of a gulp task using child_process.spawn . I have to detect when the task is done running so I'm using stdout to check for a specific string that I emit at the end of the command, but for some reason it doesn't look like my string is being emitted: // gulp 3.9.1 var gulp = require('gulp'); var spawn = require('child_process').spawn; gulp.task('my-task', function(cb) { var command = ''; // construct my shell command here var end = 'end_of_command'; var

nodejs exec command failing with no useful error message

自闭症网瘾萝莉.ら 提交于 2020-07-05 06:35:31
问题 This is the code to execute cp.exec("cc -Wall /tmp/test.c -o /tmp/test", function(e, stdout, stderr) { if (e) { var errorstr = "Compilation failed with the following error "+ e.message.toString() client.send(errorstr) console.log(e, stdout, stderr) ee.prototype.removeAllListeners() } else if (stderr.length > 0) { client.send("Compilion finished with warnings\n"+ stderr + '\n') client.send('compiled') ee.prototype.emit('compiled') } else { client.send("Compilation successful") ee.prototype

sanitize user input for child_process.exec command

旧街凉风 提交于 2020-06-13 19:32:05
问题 I'm writing a CLI using node and I've arrived at the part where I take user input and append it to a string that is the command for the child_process.exec function. const CURL_CHILD = exec('npm view --json ' + process.argv[2] + ... I am trying to figure out what I need to do to process.argv[2] before I pass it to the exec function. I've surfed around for a while and haven't found any questions or answers that address this specific case. What is the best way to sanitize this user input for

Using a pipe character | with child_process spawn

半世苍凉 提交于 2020-06-11 05:54:58
问题 I'm running nodejs on a raspberry pi and I want to run a child process to spawn a webcam stream. Outside of node my command is: raspivid -n -mm matrix -w 320 -h 240 -fps 18 -g 100 -t 0 -b 5000000 -o - | ffmpeg -y -f h264 -i - -c:v copy -map 0:0 -f flv -rtmp_buffer 100 -rtmp_live live "rtmp://example.com/big/test" With child_process I have to break each argument up var args = ["-n", "-mm", "matrix", "-w", "320", "-h", "240", "-fps", "18", "-g", "100", "-t", "0", "-b", "5000000", "-o", "-", "|"

Using a pipe character | with child_process spawn

筅森魡賤 提交于 2020-06-11 05:53:05
问题 I'm running nodejs on a raspberry pi and I want to run a child process to spawn a webcam stream. Outside of node my command is: raspivid -n -mm matrix -w 320 -h 240 -fps 18 -g 100 -t 0 -b 5000000 -o - | ffmpeg -y -f h264 -i - -c:v copy -map 0:0 -f flv -rtmp_buffer 100 -rtmp_live live "rtmp://example.com/big/test" With child_process I have to break each argument up var args = ["-n", "-mm", "matrix", "-w", "320", "-h", "240", "-fps", "18", "-g", "100", "-t", "0", "-b", "5000000", "-o", "-", "|"

Keeping track children from old runs of a script

我的梦境 提交于 2020-02-06 09:24:32
问题 I have a Perl script that spawns some children. They all take quite a while to run, creating directories and files along the way. I often notice things I'd like to change before the children die of natural causes, so then I have to shut everything down (which involves a few grep and kill calls) and delete any files the children created. It's not really a big deal, but a bit of a pain in the neck. I'd like to create a setup where the children are all monitored so when I start up the parent

Keeping track children from old runs of a script

泄露秘密 提交于 2020-02-06 09:23:26
问题 I have a Perl script that spawns some children. They all take quite a while to run, creating directories and files along the way. I often notice things I'd like to change before the children die of natural causes, so then I have to shut everything down (which involves a few grep and kill calls) and delete any files the children created. It's not really a big deal, but a bit of a pain in the neck. I'd like to create a setup where the children are all monitored so when I start up the parent

Receiving contiinuous output from python spawn child process not working

北城以北 提交于 2020-02-06 07:29:46
问题 I am attempting to stream output from a weighing scale that is written in python. This program (scale.py) runs continuously and prints the raw value every half second. import RPi.GPIO as GPIO import time import sys from hx711 import HX711 def cleanAndExit(): print "Cleaning..." GPIO.cleanup() print "Bye!" sys.exit() hx = HX711(5, 6) hx.set_reading_format("LSB", "MSB") hx.reset() hx.tare() while True: try: val = hx.get_weight(5) print val hx.power_down() hx.power_up() time.sleep(0.5) except