mirror of
				https://github.com/Dummi26/rembackup.git
				synced 2025-11-04 04:46:17 +01:00 
			
		
		
		
	add example
This commit is contained in:
		
							parent
							
								
									0092627cff
								
							
						
					
					
						commit
						7581cb24bc
					
				
							
								
								
									
										
											BIN
										
									
								
								rembackup.exe
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								rembackup.exe
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							@ -75,8 +75,7 @@ impl Specifier {
 | 
				
			|||||||
            Self::Entries(path) => path.matches(entry.path).then_some(true),
 | 
					            Self::Entries(path) => path.matches(entry.path).then_some(true),
 | 
				
			||||||
            Self::Files(path) => (!entry.is_directory && path.matches(entry.path)).then_some(true),
 | 
					            Self::Files(path) => (!entry.is_directory && path.matches(entry.path)).then_some(true),
 | 
				
			||||||
            Self::InDir { dir, inner } => {
 | 
					            Self::InDir { dir, inner } => {
 | 
				
			||||||
                dbg!(&inner);
 | 
					                if inner.0.is_empty() {
 | 
				
			||||||
                if dbg!(inner.0.is_empty()) {
 | 
					 | 
				
			||||||
                    // this has no inner things, so we just check for this directory
 | 
					                    // this has no inner things, so we just check for this directory
 | 
				
			||||||
                    // if this is a directory and it matches, then return true
 | 
					                    // if this is a directory and it matches, then return true
 | 
				
			||||||
                    (entry.is_directory && dir.matches(entry.path)).then_some(true)
 | 
					                    (entry.is_directory && dir.matches(entry.path)).then_some(true)
 | 
				
			||||||
 | 
				
			|||||||
@ -128,15 +128,17 @@ fn main() {
 | 
				
			|||||||
        );
 | 
					        );
 | 
				
			||||||
        // apply changes after confirming
 | 
					        // apply changes after confirming
 | 
				
			||||||
        if !args.noconfirm {
 | 
					        if !args.noconfirm {
 | 
				
			||||||
            let mut line = String::new();
 | 
					 | 
				
			||||||
            loop {
 | 
					            loop {
 | 
				
			||||||
                if args.target.is_none() {
 | 
					                if args.target.is_none() {
 | 
				
			||||||
                    eprintln!("[WARN] You didn't set a `target` directory!\n[WARN] Be careful not to update your index without actually applying the changes to the `target` filesystem!\nType 'Ok' and press enter to continue.");
 | 
					                    eprintln!("[WARN] You didn't set a `target` directory!\n[WARN] Be careful not to update your index without actually applying the changes to the `target` filesystem!\nType 'Ok' and press enter to continue.");
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    eprintln!("Exclude unwanted directories/files using --ignore,\nor press enter to apply the changes.");
 | 
					                    eprintln!("Exclude unwanted directories/files using --ignore,\nor press enter to apply the changes.");
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                line.clear();
 | 
					                let line = if let Some(Ok(v)) = std::io::stdin().lines().next() {
 | 
				
			||||||
                std::io::stdin().read_line(&mut line).unwrap();
 | 
					                    v
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                    return;
 | 
				
			||||||
 | 
					                };
 | 
				
			||||||
                let line = line.trim().to_lowercase();
 | 
					                let line = line.trim().to_lowercase();
 | 
				
			||||||
                if line == "exit" {
 | 
					                if line == "exit" {
 | 
				
			||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										13
									
								
								test.remignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								test.remignore
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
				
			|||||||
 | 
					# example config for this repo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# ignore all files/directories in .git except .git/index
 | 
				
			||||||
 | 
					/= .git
 | 
				
			||||||
 | 
					  *a
 | 
				
			||||||
 | 
					  except
 | 
				
			||||||
 | 
					    *= index
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# ignore the target directory
 | 
				
			||||||
 | 
					/= target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# and all files that match this glob pattern (.gitignore)
 | 
				
			||||||
 | 
					+* .git*
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user