Code Monkey home page Code Monkey logo

Comments (9)

AforDesign avatar AforDesign commented on June 12, 2024 1

Thank you! I can confirm it's working now.

If possible the script could be further improved by showing some feedback that it's running. After making sure it worked I tested the scipt on the root folder.
The script took a few minutes to finish.
It would be nice to have an indicator it's still running and not frozen.

from dropboxignore.

sp1thas avatar sp1thas commented on June 12, 2024

Hello @AforDesign and happy new year.

Thank you for your kind words and for your feedback.

dropboxignore supports Mac OS but has been tested only on Linux :/, therefore, this is probably a bug. Can you provide some more details in order to reproduce the case?

  • the content of generated .dropboxignore files.
  • the commands that you run and the standard output (use -v 2 parameter in order to print debug messages)
  • the folder/file structure

from dropboxignore.

AforDesign avatar AforDesign commented on June 12, 2024

I ran into a few issues so it took me a bit longer to do some tests.

For the reproduction steps I installed a default laravel app in my websites folder.
Then I used he dropboxignore generate command to only target the main .gitignore file (btw works fine recursively).
Step 4 and 5 aren't really nescecary as the vendor folder, which is included in the .gitignore file has content by default

  1. create dir in websites folder: "local.dropboxignore.com"
  2. $ cd /myroot/websites/local.dropboxignore.com
  3. $ composer create-project laravel/laravel example-app
  4. (optional) $ cd example-app
  5. (optional) $ npm install
  6. $ dropboxignore generate dropboxignore generate /myroot/websites/local.dropboxignore.com/example-app/.gitignore -v 2

content .dropboxignore:

# ----
# Automatically Generated .dropboxignore file at do  7 jan 2021 15:54:26 CET
# ----
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
# ----

debug messages:
/usr/local/bin/dropboxignore: line 65: [: : integer expression expected
/usr/local/bin/dropboxignore: line 65: [: : integer expression expected
/usr/local/bin/dropboxignore: line 51: [: : integer expression expected
/usr/local/bin/dropboxignore: line 51: [: : integer expression expected

What I ultimately would like to achieve is 1 single .dropboxignore file in my 'websites' root dir, targetting at least all node_modules, vendor, cache and log folders in each underlying website folder.

from dropboxignore.

sp1thas avatar sp1thas commented on June 12, 2024

Well I'm pretty sure that the leading slash is causing the problem, try to manually update the .dropboxignore file based on the following and run dropboxignore ignore again

.dropboxignore:

# ----
# Automatically Generated .dropboxignore file at do  7 jan 2021 15:54:26 CET
# ----
node_modules
public/hot
public/storage
storage/*.key
vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
# ----

Reproducing your case:

$ mkdir -p /root/websites/local.dropboxignore.com/
$ cd /root/websites/local.dropboxignore.com
$ composer create-project laravel/laravel example-app
$ cd example-app/
$ dropboxignore generate .
 Created file: bootstrap/cache/.dropboxignore
 Created file: database/.dropboxignore
 Created file: .dropboxignore
 Created file: storage/app/.dropboxignore
 Created file: storage/app/public/.dropboxignore
 Created file: storage/framework/sessions/.dropboxignore
 Created file: storage/framework/cache/data/.dropboxignore
 Created file: storage/framework/cache/.dropboxignore
 Created file: storage/framework/testing/.dropboxignore
 Created file: storage/framework/.dropboxignore
 Created file: storage/framework/views/.dropboxignore
 Created file: storage/logs/.dropboxignore

Total number of generated files: 12
$ cat .dropboxignore
# ----
# Automatically Generated .dropboxignore file at Thu Jan  7 18:08:36 EET 2021
# ----
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
# ----
$ sed -i 's/^\///' .dropboxignore  # or remove leading slashes manually
$ cat .dropboxignore
# ----
# Automatically Generated .dropboxignore file at Thu Jan  7 18:08:36 EET 2021
# ----
node_modules
public/hot
public/storage
storage/*.key
vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
# ----
$ dropboxignore ignore .

Total number of ignored files: 32

Note

Re-install dropboxignore in order to use the latest version.

from dropboxignore.

AforDesign avatar AforDesign commented on June 12, 2024

Ah, I see.
The ignore command actually activates the .dropboxignore file
I've used it the wrong way and remember having issues with it earlier.

The ignore command gives the following error:
/usr/local/bin/dropboxignore: line 301: getfattr: command not found

I've looked it up and found the following information:
source: https://www.lesbonscomptes.com/pages/extattrs.html

Specific command line utilities
Linux has the 'getfattr' and 'setfattr' utilities to retrieve and set xattrs. On Debian, you need to install the 'attr' package to get them.

FreeBSD has 'getextattr', 'lsextattr', 'rmextattr', 'setextattr'

Mac OS X has 'xattr'.

from dropboxignore.

sp1thas avatar sp1thas commented on June 12, 2024

Good catch! I will fix it asap and I will let you now

from dropboxignore.

sp1thas avatar sp1thas commented on June 12, 2024

@AforDesign I've made a fix, please install the latest version and test it again.

from dropboxignore.

sp1thas avatar sp1thas commented on June 12, 2024

@AforDesign happy to hear that!

Regarding the output, you definitely have a point. We should find the sweet-spot between printing every ignored file (ignored files could be hundreds) and printing only the number of ignored files.

regarding the progress, a simple spinner like this could be used.

Thank you for your valuable feedback and I will keep you up-to-date.

from dropboxignore.

AforDesign avatar AforDesign commented on June 12, 2024

A spinner like that would be great.
Even better though if a counter could be included that states the number of ignored files during the process.
This would be a great indicator the script is running succesfully.

Printing the ignored files isn't nescecary. You allready implemented list function for that.

from dropboxignore.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.