Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

If the files already exist, they are not updated, but deleted #60

Closed
lmeyer1 opened this issue Jan 11, 2019 · 3 comments
Closed

If the files already exist, they are not updated, but deleted #60

lmeyer1 opened this issue Jan 11, 2019 · 3 comments
Labels

Comments

@lmeyer1
Copy link
Contributor

lmeyer1 commented Jan 11, 2019

Describe the Issue

Using the command line cmd on Windows 10, ssc pull will not update the files, but delete them if they already exist.

C:\..\git\database_folder>ssc pull
√ Successfully added 1098, updated 0, and removed 1098 files.

Expected behavior

As advertised, the tool should update changed files, based on cache.json

Steps to Reproduce

Run ssc pull in Windows terminal two times one after another.

Workaround

Delete all files before ssc pull

rmdir /s /q database_folder/
md database_folder/
copy ssc.json database_folder/ssc.json
cd database_folder/
ssc pull
@justinlettau
Copy link
Owner

@lmeyer1 I can't reproduce this issue. I'm also on Windows 10. Can you provide some details on your config, database, etc?

@lmeyer1
Copy link
Contributor Author

lmeyer1 commented Jan 15, 2019

Hello,
I looked into your code and found the issue:

My config file had root: '.'.

In file-utility.ts:174, existingFiles was something like [ './schemas/dbo.sql', ... ], but in file-utility.ts:148 after normalizing, the filename was 'schemas/dbo.sql.

After changing the configuration to root: './', normalization works as expected, and files are no longer removed.

@justinlettau
Copy link
Owner

I'm glad you got this resolved. I'll see about adding some handling for that specific config scenario to avoid this issue in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants