mirror of
				https://github.com/wting/autojump
				synced 2025-06-13 12:54:07 +00:00 
			
		
		
		
	install-py: add distribution argument
This commit is contained in:
		
							parent
							
								
									4230bbe2d1
								
							
						
					
					
						commit
						f35b2dd14e
					
				
							
								
								
									
										11
									
								
								install.py
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								install.py
									
									
									
									
									
								
							@ -93,6 +93,9 @@ def parse_arguments():  # noqa
 | 
			
		||||
    parser.add_argument(
 | 
			
		||||
        '-s', '--system', action="store_true", default=False,
 | 
			
		||||
        help='install system wide for all users')
 | 
			
		||||
    parser.add_argument(
 | 
			
		||||
        '--distribution', action="store_true", default=False,
 | 
			
		||||
        help='enable installation to a distribution')
 | 
			
		||||
 | 
			
		||||
    args = parser.parse_args()
 | 
			
		||||
 | 
			
		||||
@ -168,8 +171,10 @@ def main(args):
 | 
			
		||||
        print("Installing autojump to %s ..." % args.destdir)
 | 
			
		||||
 | 
			
		||||
    bin_dir = os.path.join(args.destdir, args.prefix, 'bin')
 | 
			
		||||
    root_etc_dir = os.path.join('/', 'etc', 'profile.d')
 | 
			
		||||
    etc_dir = os.path.join(args.destdir, 'etc', 'profile.d')
 | 
			
		||||
    doc_dir = os.path.join(args.destdir, args.prefix, 'share', 'man', 'man1')
 | 
			
		||||
    root_share_dir = os.path.join('/', args.prefix, 'share', 'autojump')
 | 
			
		||||
    share_dir = os.path.join(args.destdir, args.prefix, 'share', 'autojump')
 | 
			
		||||
    zshshare_dir = os.path.join(args.destdir, args.zshshare)
 | 
			
		||||
 | 
			
		||||
@ -207,8 +212,14 @@ def main(args):
 | 
			
		||||
        cp('./bin/_j', zshshare_dir, args.dryrun)
 | 
			
		||||
 | 
			
		||||
        if args.custom_install:
 | 
			
		||||
            if args.distribution:
 | 
			
		||||
                modify_autojump_sh(etc_dir, root_share_dir, args.dryrun)
 | 
			
		||||
            else:
 | 
			
		||||
                modify_autojump_sh(etc_dir, share_dir, args.dryrun)
 | 
			
		||||
 | 
			
		||||
    if args.distribution:
 | 
			
		||||
        show_post_installation_message(root_etc_dir, root_share_dir, bin_dir)
 | 
			
		||||
    else:
 | 
			
		||||
        show_post_installation_message(etc_dir, share_dir, bin_dir)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user