SmalltalkStartup.st
author Jan Vrany <jan.vrany@labware.com>
Thu, 06 Aug 2020 09:33:44 +0100
branchjv
changeset 1626 62ac134d4f7f
parent 1558 36927a04ace3
child 1632 d5aeb42a3916
permissions -rw-r--r--
`smalltalk`: remove trailing spaces from UNIX launcher script
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1442
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"
1558
36927a04ace3 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1485
diff changeset
     2
 COPYRIGHT (c) 2016 Jan Vrany <jan.vrany@fit.cvut.cz>
1442
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
              All Rights Reserved
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
 hereby transferred.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
"{ Package: 'stx:projects/smalltalk' }"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
"{ NameSpace: Smalltalk }"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
StandaloneStartup subclass:#SmalltalkStartup
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
	instanceVariableNames:''
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
	classVariableNames:''
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
	poolDictionaries:''
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
	category:'Interface-Smalltalk'
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
!
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
!SmalltalkStartup class methodsFor:'documentation'!
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
copyright
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
 COPYRIGHT (c) 2006 by eXept Software AG
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
               2016-now by Jan Vrany <jan.vrany@fit.cvut.cz>
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
              All Rights Reserved
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
 This software is furnished under a license and may be used
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
 only in accordance with the terms of that license and with the
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
 be provided or otherwise made available to, or used by, any
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
 other person.  No title to or ownership of the software is
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
 hereby transferred.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
!
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
documentation
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
    Smalltalk/X IDE startup.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
    For historical reasons, IDE startup is not actually implemented as
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
    a StandaloneStartup class as for Smalltalk/X-based applications.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
    Instead, the Smalltalk>>start reads smalltalk.rc and startup procedure
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
    is defined there.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
    In order to reduce a number of .rc script hackery, functionality will be
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
    incrementally moved from those scripts to this class and scripts will be
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
    changed to call methods in this class. Eventually we will reach the point
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
    when scripts will be empty and all functionality will be here. Let's hope.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
    [author:]
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
        Jan Vrany <jan.vrany@fit.cvut.cz>
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
    [instance variables:]
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
    [class variables:]
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
    [see also:]
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
! !
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
1447
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    66
!SmalltalkStartup class methodsFor:'startup-to be redefined'!
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    67
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    68
main:argv
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    69
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    70
    "/ Due to a historical reasons (see this class's comment), this 
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    71
    "/ method is called from `smalltalk.rc` startup script manually. 
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    72
    "/ Hopefully at some point we will move all the code from there
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    73
    "/ to here. Hopefully...
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    74
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    75
    | optparser unparsed |
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    76
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    77
    optparser := CmdLineParser new.
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    78
    optparser ignoreUnknownOptions: true.
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    79
    optparser on:#('--package-path PATH') do:[:pp |  
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    80
        (pp asCollectionOfSubstringsSeparatedBy: OperatingSystem pathSeparator) reverseDo:[:e |
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    81
            Smalltalk packagePath addFirst: e  
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    82
        ]
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    83
    ].
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    84
    unparsed := optparser parse: argv.
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    85
    argv isOrderedCollection ifTrue:[
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    86
        argv removeAll; addAll: unparsed.
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    87
    ].
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    88
1485
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    89
    "/ Ask user to accept 'Smalltalk/X Software Licence Agreement'. 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    90
    "/ This could be suppressed with a command-line argument;
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    91
    "/ however, if you do so, we assume you have read & accepted it at least
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    92
    "/ once (since this command-line-argument is not documented, you obviously
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    93
    "/ read the code below).        
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    94
    (argv includesAny: #('--noLicenceBox' '--quick' '--faststart' '--fastStart')) ifFalse:[
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    95
        Smalltalk addStartBlock:[                            
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    96
        	self acceptLicense 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    97
        ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    98
    ]
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    99
1447
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   100
    "
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   101
    SmalltalkStartup main: #('-I' '--quick' '--package-path' '/home/some/packages') asOrderedCollection.
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   102
    Smalltalk packagePath
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   103
    "
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   104
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   105
    "Created: / 28-06-2016 / 23:43:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1485
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   106
    "Modified: / 31-12-2016 / 00:02:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   107
! !
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   108
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   109
!SmalltalkStartup class methodsFor:'startup-utilities'!
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   110
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   111
acceptLicense
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   112
    "
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   113
    Ask user to accept 'Smalltalk/X Software Licence Agreement'. If rejected,
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   114
    exit.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   115
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   116
    You may find this annoying - but lawers say: 'this is a must ...' ;-)
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   117
    License Agreement is shown only once.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   118
    "
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   119
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   120
    | licenseAcceptedFile |
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   121
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   122
    licenseAcceptedFile := Filename homeDirectory / '.smalltalk' / '.license-accepted'.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   123
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   124
    (Smalltalk isStandAloneApp or:[ Smalltalk isPlugin or:[ Display isNil]]) ifTrue:[ 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   125
        ^ self
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   126
    ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   127
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   128
    licenseAcceptedFile exists ifTrue:[ 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   129
        "/ License has been already accepted, don't dhow it again
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   130
        ^ self 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   131
    ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   132
    LicenceBox autoload.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   133
    [
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   134
       | licenseAcceptedDir |
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   135
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   136
	   Display exitOnLastClose:false.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   137
       (LicenceBox open) ifFalse:[
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   138
           Smalltalk exit
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   139
       ].              
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   140
       licenseAcceptedDir := licenseAcceptedFile directory.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   141
       licenseAcceptedDir exists ifFalse:[
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   142
           licenseAcceptedDir recursiveMakeDirectory.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   143
       ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   144
       licenseAcceptedDir isWritable ifTrue:[
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   145
           licenseAcceptedFile writingFileDo:[ :s| s nextPutLine: 'accepted' ]
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   146
       ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   147
    ] on: LicenceBox licenceRejectSignal do:[ 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   148
        Smalltalk exit
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   149
    ] on: Error do:[
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   150
        "/ Ignore this, but user will be acc
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   151
    ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   152
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   153
    "
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   154
    SmalltalkStartup acceptLicense
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   155
    "
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   156
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   157
    "Created: / 30-12-2016 / 23:41:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1447
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   158
! !
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   159
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   160
!SmalltalkStartup class methodsFor:'documentation'!
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   161
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   162
version_HG
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   163
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   164
    ^ '$Changeset: <not expanded> $'
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   165
! !
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   166