question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2nd/later scaffold run results in: scaffold.css already exists

See original GitHub issue

ENVIRONMENT

0.1.0

OBSERVATION

I ran yarn rw g scaffold NAME for my first model, worked fine.

I ran yarn rw g scaffold NAME for my second model, failed after writing 3 out of 15 files:

$ yarn rw g scaffold workspace
yarn run v1.21.1
$ /Users/chris/proj/aw-hammer/node_modules/.bin/rw g scaffold workspace
❯ Generating scaffold files...
    ✔ Writing `./api/src/graphql/workspaces.sdl.js`...
    ✔ Writing `./api/src/services/workspaces/workspaces.test.js`...
    ✔ Writing `./api/src/services/workspaces/workspaces.js`...
    ✖ Writing `./web/src/scaffold.css`...
    → /Users/chris/proj/aw-hammer/web/src/scaffold.css already exists.
    Writing `./web/src/layouts/WorkspacesLayout/WorkspacesLayout.js`...
    Writing `./web/src/pages/EditWorkspacePage/EditWorkspacePage.js`...
    Writing `./web/src/pages/WorkspacePage/WorkspacePage.js`...
    Writing `./web/src/pages/WorkspacesPage/WorkspacesPage.js`...
    Writing `./web/src/pages/NewWorkspacePage/NewWorkspacePage.js`...
    Writing `./web/src/components/EditWorkspaceCell/EditWorkspaceCell.js`...
    Writing `./web/src/components/Workspace/Workspace.js`...
    Writing `./web/src/components/WorkspaceCell/WorkspaceCell.js`...
    Writing `./web/src/components/WorkspaceForm/WorkspaceForm.js`...
    Writing `./web/src/components/Workspaces/Workspaces.js`...
    Writing `./web/src/components/WorkspacesCell/WorkspacesCell.js`...
    Writing `./web/src/components/NewWorkspace/NewWorkspace.js`...
    Adding scaffold routes...
    Adding scaffold asset imports...
/Users/chris/proj/aw-hammer/web/src/scaffold.css already exists.

The files listed before the “X” line were generated; those after were not.

It’s fine that generate scaffold would create the default version of scaffold.css if one doesn’t exist. If one does exist, the process should continue without treating that as an error.

The process should skip over an existing file, since it may have been created by a prior run and left alone (= same file), or the user has altered it (= would not appreciate having it overwritten).

WORKAROUND

Temporarily – move or delete the file before each generate.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
peterpcommented, Mar 23, 2020

@weaversam8 that’s 100% the problem. Sorry, I didn’t realise you’re on Windows.

1reaction
cannikincommented, Mar 10, 2020

Yeah that should just skip scaffold.css if it already exists, sorry about that. You can add a --force flag on your generate command and it will just overwrite it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rails scaffolds scss reset each time a scaffold is generated
Each time I do a rails generate scaffold Name , the app/assets/stylesheets/scaffolds.css.scss file is overwritten (well I get prompted to overwrite it).
Read more >
Getting Started with Scaffold: A Primer for Viewer Users
As this guide is primarily intended for users who will run Scaffold in viewer mode only, when prompted for a key by Scaffold,...
Read more >
Generating view scaffolding code for existing models
I've been thinking for a while that a generator that creates view scaffolding for an existing model or models would be really useful....
Read more >
Technion_HS_2015_final_2014hs.txt - iGEM
I've been part of the high school iGEM team for two years now and find the science behind it fascinating. In school, I...
Read more >
Vattel PDF - Scribd
The reproduction of the lithograph having given better results than that of the picture, ... Struck by the lack of har mony that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found