Tools: app-drawer-template not working

Created on 20 May 2016  Â·  9Comments  Â·  Source: Polymer/tools

Nodejs 5.1.0
Windows 10
run poly-cli on cmd and powershell

the element and application template working ok. but, when I select app-drawer-template that not working.

Screenshot:
image

Init cli Windows Critical Available Bug

All 9 comments

Thanks for the report @menorless. FYI, we're in the process of setting Windows CI servers to make sure any fixes we do stay fixed.

Similar issue for me. Using 'polymer init app-drawer-template' via tutorial for creating an app, the directory that should be created in my file, does not appear. At first, I received the error that the bower.json file did not exist, so I spent a couple of days searching around in an attempt to learn what may be causing the error (I'm learning node, npm, bower, and polymer), and this morning, based on advice I found, I tried a bower init in my newly created 'poly-app' file. This created the bower.json file and eliminates that error, but did not help to 'pull' the files I needed from Polymer-CLI into my new file.

@PCPrincess
there is a path issue, because unix and windows path system is different
In polymer-cli windows, template being downloaded and extracted to invalid path.
fastest way is clone the git template
git clone https://github.com/Polymer/app-drawer-template.git

Fixed with
polymer-cli/src/github/github.ts

extractLatestRelease(outDir: string): Promise<void> {
    return new Promise<void>((resolve, reject) => {
      let tarPipe = tar.extract(outDir, {
      ignore: (_, header) => {
          //fix path
          header.name = path.join('', header.name);
          let splitPath = header.name.split(path.sep);
          // ignore the top directory in the tarfile to unpack directly to
          // the cwd
          // ignore only directory
          return (splitPath.length < 2 || splitPath[1] === '') && header.type == 'folder';
        },
      map: (header) => {
          //fix path
          header.name = path.join('', header.name);
          let unprefixed =
              header.name.split(path.sep).slice(1).join(path.sep).trim();
          // the ./ is needed to unpack top-level files in the tar, otherwise
          // they're just not written
          //fix path
          header.name = path.join('./', unprefixed);
          return header;
        },
      });

Thanks! – That is exactly what I did. Working perfectly thus far ; )

From: Teno Siswono [mailto:[email protected]]
Sent: Sunday, May 22, 2016 10:59 AM
To: Polymer/polymer-cli [email protected]
Cc: PCPrincess [email protected]; Mention [email protected]
Subject: Re: [Polymer/polymer-cli] app-drawer-template not working (#181)

@PCPrincess https://github.com/PCPrincess
there is a path issue, because unix and windows path system is different
In polymer-cli windows, template being downloaded and extracted to invalid path.
fastest way is clone the git template
git clone https://github.com/Polymer/app-drawer-template.git

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub https://github.com/Polymer/polymer-cli/issues/181#issuecomment-220846335 https://github.com/notifications/beacon/AI081gyo5pDoh2josDuKRWXOHQtfbA2Zks5qEJlJgaJpZM4IjeFR.gif

I am having this issue as well, but when running polymer init application I i get the following:

capture

Running node 4.4.5 and most recent build from polymer/bower on Windows 7

will clone the template for now, but wanted to add this in for you guys.

When I updated the polymer-cli recently I get the same issue of @qwoodmansee too

By the moment I've fixed it commenting the 2 first "asserts" in NODE_PATH/lib/node_modules/polymer-cli/node_modules/yeoman-generator/lib/util/storage.js

var Storage = module.exports = function Storage(name, fs, configPath) {
  // assert(name, 'A name parameter is required to create a storage');
  // assert(configPath, 'A config filepath is required to create a storage');

  this.path = configPath;
  this.name = name;
  this.fs = fs;
  this.existed = Object.keys(this._store()).length > 0;
};

I don't know if it was a good idea, but it works.

This should be resolved as of v0.13.0!

Please file another bug with steps to reproduce if you run into it again.

Was this page helpful?
0 / 5 - 0 ratings