terminal - Dart string interpolation through console run script -


I am using Dart to generate controller classes in the project structure using the script created in the tool directory. . The script is run using the following terminal commands (in the project directory of the course):

  Dart Tools / Controller_kart Dart Controller Name   

This script runs Using the string 'projection' to inject the following script and name in the required fields by taking the 'Controller name' parameter before using the console to use it as the value for the 'name' variable. Is:

  import 'dart: io'; Zero main (string name) {string content = "" part of controllers; Class $ extends name controller {// ------------------------- -------------- ------------------------------------ -------------- - // functions // ----------------------------- -------------- ------------------------------------ ------------ / * * * Meets the criteria and launches Superclass constructor / $ name (): Super (new virtual directory (root_package_dir)) {virtualDirectory.allowDirectoryListing = false; Virtual Directory.GelRoot = True; } // ----------------------------------------------- -------------------------------------------- // Work - Controller / / ------------------------------------------------- ------------------------------------------ Zero Index (HTTPPending Request) {Virtual Directory .serveFile (new file (views_dir + "/index.html"), request);}} "" "; New file ('$ name.dart'). WriteAsString (content). Then (file file) {}) ;}   

However, the problem I have encountered is that the given string does not inject the 'controller name' to specified fields, rather than '[the controller name]', and me It quits what it is and how can I avoid it?

Thanks for reading! This is the first terminal driven script I have created so I apologize if it Normal behavior is for the terminal pass variable.

Despite your method signing for the main, the command line Logic is actually passed as list & lt; string & gt; I So string launches sees an element, a list containing the controller name .

Change the main void main (list & lt; string & gt; Args) and create a new field var name = arguments [0] .

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -