Node: child_process.spawn مشكلة علامات الاقتباس المزدوجة في معلمات [args].

تم إنشاؤها على ٢٦ ديسمبر ٢٠١٦  ·  1تعليق  ·  مصدر: nodejs/node

  • الإصدار 7.2.1 :
  • 64 بت (Windows 10) :
  • عملية_الأطفال :


ولدي مشكلة إذا استخدمت علامات الاقتباس المزدوجة في معاملات child_process.spawn [args].
مثال:

let ps = spawn('ant.bat', ['-propertyfile ', prop1, '-propertyfile ', prop2, '-Dgit.branch='+branch, '-Dinstallfile.suffix="'+prop4+'"'];

نتيجة لذلك ، حصلت على خطأ في الكود الخاص بي ، لأن normalizeSpawnArguments () تأخذ جميع سلاسل الأوامر في علامات اقتباس مزدوجة أيضًا. لذا يرجى محاولة التعامل مع هذا الموقف في normalizeSpawnArguments أو وصف هذا القيد في المستندات.

child_process question

التعليق الأكثر فائدة

حاول Sergaros ضبط خيار shell:

let ps = spawn('ant.bat', ['-propertyfile ', prop1, '-propertyfile ', prop2, '-Dgit.branch='+branch, '-Dinstallfile.suffix="'+prop4+'"'], { shell:true });

المستندات ذات الصلة: https://nodejs.org/dist/v7.2.1/docs/api/child_process.html#child_process_spawning_bat_and_cmd_files_on_windows

>كل التعليقات

حاول Sergaros ضبط خيار shell:

let ps = spawn('ant.bat', ['-propertyfile ', prop1, '-propertyfile ', prop2, '-Dgit.branch='+branch, '-Dinstallfile.suffix="'+prop4+'"'], { shell:true });

المستندات ذات الصلة: https://nodejs.org/dist/v7.2.1/docs/api/child_process.html#child_process_spawning_bat_and_cmd_files_on_windows

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات